brgndy-toast
v1.0.2
Published
toast-library-component
Downloads
3
Readme
brgndy-react-toast
Toast Library Component for React
- Running Video
- Usage
function App() {
const handleNotifyClick = () => {
toast.notify('It is a notify message!', 1000);
};
const handleWarningClick = () => {
toast.warning('This is a warning message!', 2000);
};
const handleErrorClick = () => {
toast.error('This is an error message!', 3000);
};
const handleSuccessClick = () => {
toast.success('This is a Success message!', 4000);
};
return (
<>
<button onClick={handleNotifyClick}>Show Notify Toast</button>
<button onClick={handleWarningClick}>Show Warning Toast</button>
<button onClick={handleErrorClick}>Show Error Toast</button>
<button onClick={handleSuccessClick}>Show Success Toast</button>
<ToastContainer />
</>
);
}
export default App;
- Caveat
First, the ToastContainer component must be defined in the root component.