Last active
May 14, 2022 17:02
-
-
Save petrosDemetrakopoulos/ca55531bf97ee463929353240492c2cb to your computer and use it in GitHub Desktop.
React toasts App.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| import './App.css' | |
| import { ToastContainer, toast } from 'react-toastify'; | |
| import 'react-toastify/dist/ReactToastify.css'; | |
| function App() { | |
| const notifyDefault = () => toast("A toast alert!"); | |
| return ( | |
| <div className="App"> | |
| <div style={{ marginTop: '2em' }}> | |
| <button onClick={notifyDefault}>Show default toast</button> | |
| </div> | |
| <ToastContainer /> | |
| </div> | |
| ) | |
| } | |
| export default App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment