Created
October 16, 2023 11:57
-
-
Save rahulmore01/3cc6d4b95cde9088ef604355a6bbfb71 to your computer and use it in GitHub Desktop.
react-hot-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 { toast } from 'react-hot-toast'; | |
| function MyComponent() { | |
| const handleButtonClick = () => { | |
| toast.success('You did it!'); // Displays a success message | |
| }; | |
| return ( | |
| <div> | |
| <button onClick={handleButtonClick}>Show Success Toast</button> | |
| </div> | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment