Created
December 27, 2022 02:29
-
-
Save luizcalaca/6f1b673df7e22c93a1743719f1d5299a to your computer and use it in GitHub Desktop.
React.js + toast
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 { toast, ToastContainer } from "react-toastify"; | |
| import "react-toastify/dist/ReactToastify.css"; | |
| export function App() { | |
| function handleClick() { | |
| toast.error('error'); | |
| } | |
| return ( | |
| <> | |
| <button onClick={handleClick}> | |
| Toast | |
| </button> | |
| <ToastContainer autoClose={3000} position={toast.POSITION.BOTTOM_LEFT} /> | |
| </> | |
| ); | |
| } | |
| export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment