Last active
January 12, 2020 22:02
-
-
Save aibolik/15a033d5ec57306fd3f33be487236a8a to your computer and use it in GitHub Desktop.
Usage of ToastContext without useToast hook (part of https://aibolik.github.io/blog/creating-toast-api-with-react-hooks)
This file contains 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 { ToastContext } from './path/to/ToastProvider'; | |
const Example = () => { | |
const { addToast } = React.useContext(ToastContext); | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment