Last active
November 1, 2018 03:07
-
-
Save jossmac/1f0c8781722b6bbb91b2c725e3b5ca73 to your computer and use it in GitHub Desktop.
Pseudo code for a consumer component
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 React from 'react'; | |
import { ToastContext } from './Provider'; | |
export const ToastConsumer = ({ children }) => ( | |
<ToastContext.Consumer> | |
{context => children(context)} | |
</ToastContext.Consumer> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment