Wrapping in App.js
Closed this issue · 2 comments
ChristopherJohnson25 commented
How would I go about wrapping my entire app with this? I'm using a UI theme that takes a theme in app.js, and changes all the views. See below...
const App = () => (
<React.Fragment>
<IconRegistry icons={EvaIconsPack} />
<ApplicationProvider mapping={mapping} theme={theme}>
<ApplicationContent />
</ApplicationProvider>
</React.Fragment>
);
DimitarNestorov commented
This should work:
const App = () => {
const theme = useDarkModeContext()
return <React.Fragment>
<IconRegistry icons={EvaIconsPack} />
<ApplicationProvider mapping={mapping} theme={theme}>
<ApplicationContent />
</ApplicationProvider>
</React.Fragment>
}
ChristopherJohnson25 commented
Hmm can't get that exact thing to work, but I get the idea. Thanks!!