Created
June 12, 2021 23:46
-
-
Save ahayes91/436bfe5bb5176cacbf6d9be7967e5106 to your computer and use it in GitHub Desktop.
An example of the providers and wrapped functionality around a more complex app in a microfrontend Single-SPA application
This file contains hidden or 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'; | |
// ... all the other stuff our app uses, Redux Saga / custom providers / MUI components & themes / i18n | |
const App = ({ basename }) => { | |
const { userContext } = getUserCtx(); | |
return ( | |
<BrowserRouter basename={basename}> | |
<LocaleProvider> | |
{locale => ( | |
<MuiThemeProvider theme={studentTheme}> | |
<CssBaseline /> | |
<Provider store={store}> | |
<IntlProvider locale={locale} messages={getLocaleFile(locale)}> | |
<Routes userContext={userContext} /> | |
</IntlProvider> | |
</Provider> | |
</MuiThemeProvider> | |
)} | |
</LocaleProvider> | |
</BrowserRouter> | |
); | |
}; | |
App.propTypes = { | |
basename: PropTypes.string, | |
}; | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment