Last active
July 6, 2018 03:01
-
-
Save daveols/aa560a862800d1306797ef5ecf50896d to your computer and use it in GitHub Desktop.
React Loads - with multiple providers
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
const withLoadsProvider = WrappedComponent => props => ( | |
<LoadsProvider> | |
<WrappedComponent {...props}/> | |
</LoadsProvider> | |
) | |
const Router = createRoutes({ | |
'/eggs': withLoadsProvider(Eggs), | |
'/bacon': withLoadsProvider(Bacon) | |
}) | |
const App = () => <Router /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment