Created
January 14, 2019 15:39
-
-
Save aloukissas/6eb31b7957bdc367829930c3c5382d56 to your computer and use it in GitHub Desktop.
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"; | |
export const AuthContext = React.createContext({}); | |
export const withAuthContext = ChildComponent => props => ( | |
<AuthContext.Consumer> | |
{context => <ChildComponent {...props} auth={context} />} | |
</AuthContext.Consumer> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment