Skip to content

Instantly share code, notes, and snippets.

@daveols
Last active July 6, 2018 03:01
Show Gist options
  • Save daveols/aa560a862800d1306797ef5ecf50896d to your computer and use it in GitHub Desktop.
Save daveols/aa560a862800d1306797ef5ecf50896d to your computer and use it in GitHub Desktop.
React Loads - with multiple providers
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