Skip to content

Instantly share code, notes, and snippets.

@aibolik
Last active January 12, 2020 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aibolik/15a033d5ec57306fd3f33be487236a8a to your computer and use it in GitHub Desktop.
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)
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