This repository has been archived by the owner on Sep 11, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrade(react-router-redux): ^3.0.0 -> ^4.0.0-beta
- Loading branch information
David Zukowski
committed
Feb 12, 2016
1 parent
3b57c1c
commit 0df2690
Showing
4 changed files
with
20 additions
and
13 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,29 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import { browserHistory } from 'react-router' | ||
import { syncHistoryWithStore } from 'react-router-redux' | ||
import makeRoutes from './routes' | ||
import Root from './containers/Root' | ||
import configureStore from './redux/configureStore' | ||
|
||
// Create redux store and sync with react-router-redux. We have installed the | ||
// react-router-redux reducer under the key "router" in src/routes/index.js, | ||
// so we need to provide a custom `selectLocationState` to inform | ||
// react-router-redux of its location. | ||
const initialState = window.__INITIAL_STATE__ | ||
const store = configureStore({ initialState, history }) | ||
const store = configureStore(initialState) | ||
const history = syncHistoryWithStore(browserHistory, store, { | ||
selectLocationState: (state) => state.router | ||
}) | ||
|
||
// Now that we have the Redux store, we can create our routes. We provide | ||
// the store to the route definitions so that routes have access to it for | ||
// hooks such as `onEnter`. | ||
const routes = makeRoutes(store) | ||
|
||
// Render the React application to the DOM | ||
// Now that redux and react-router have been configured, we can render the | ||
// React application to the DOM! | ||
ReactDOM.render( | ||
<Root history={browserHistory} routes={routes} store={store} />, | ||
<Root history={history} routes={routes} store={store} />, | ||
document.getElementById('root') | ||
) |
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
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
If i'm right, you don't use this module