Created
March 19, 2019 09:16
-
-
Save egorguscha/4b09020e9e011599f0633405677ac824 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
// index.js | |
const render = () => | |
ReactDOM.render( | |
<Provider store={store}> | |
<ConnectedRouter history={history}> | |
<App /> | |
</ConnectedRouter> | |
</Provider>, | |
root | |
) | |
if (module.hot) { | |
module.hot.accept(render) | |
} | |
render() | |
// app.js | |
const AppView = () => ( | |
<> | |
<RouterConfig /> | |
<GlobalStyle /> | |
</> | |
) | |
export const App = hot(module)(AppView) | |
// routes.js | |
export const RouterConfig = () => ( | |
<Switch> | |
{commonRoutes().map((routes, i) => { | |
return <Route key={i} {...routes} /> | |
})} | |
</Switch> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment