11import React from 'react'
22import ReactDOM from 'react-dom'
33import createBrowserHistory from 'history/lib/createBrowserHistory'
4- import { Router , useRouterHistory } from 'react-router'
4+ import { useRouterHistory } from 'react-router'
55import { syncHistoryWithStore } from 'react-router-redux'
66import createStore from './store/createStore'
7- import { Provider } from 'react-redux '
7+ import AppContainer from './containers/AppContainer '
88
99// ========================================================
1010// Browser History Setup
@@ -17,7 +17,7 @@ const browserHistory = useRouterHistory(createBrowserHistory)({
1717// Store and History Instantiation
1818// ========================================================
1919// Create redux store and sync with react-router-redux. We have installed the
20- // react-router-redux reducer under the key "router" in src/routes/index.js,
20+ // react-router-redux reducer under the routerKey "router" in src/routes/index.js,
2121// so we need to provide a custom `selectLocationState` to inform
2222// react-router-redux of its location.
2323const initialState = window . ___INITIAL_STATE__
@@ -40,16 +40,18 @@ if (__DEBUG__) {
4040// ========================================================
4141const MOUNT_NODE = document . getElementById ( 'root' )
4242
43- let render = ( key = null ) => {
43+ let render = ( routerKey = null ) => {
4444 const routes = require ( './routes/index' ) . default ( store )
45- const App = (
46- < Provider store = { store } >
47- < div style = { { height : '100%' } } >
48- < Router history = { history } children = { routes } key = { key } />
49- </ div >
50- </ Provider >
45+
46+ ReactDOM . render (
47+ < AppContainer
48+ store = { store }
49+ history = { history }
50+ routes = { routes }
51+ routerKey = { routerKey }
52+ /> ,
53+ MOUNT_NODE
5154 )
52- ReactDOM . render ( App , MOUNT_NODE )
5355}
5456
5557// Enable HMR and catch runtime errors in RedBox
0 commit comments