Skip to content

Instantly share code, notes, and snippets.

@jaouadballat
Created June 3, 2019 15:25
Show Gist options
  • Save jaouadballat/4a0fb310d86f5fae85c40a515ca675e9 to your computer and use it in GitHub Desktop.
Save jaouadballat/4a0fb310d86f5fae85c40a515ca675e9 to your computer and use it in GitHub Desktop.
import React, { useEffect, useState } from 'react';
import './index.css';
export const Flash = () => {
let [visibility, setVisibility] = useState(false);
let [message, setMessage] = useState('');
let [type, setType] = useState('');
return (
visibility && <div className={`alert alert-${type}`}>
<span className="close"><strong>X</strong></span>
<p>{message}</p>
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment