Skip to content
This repository was archived by the owner on Sep 8, 2021. It is now read-only.

fix fetching initial state from redux store #30

Merged
merged 1 commit into from
Dec 14, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ class App extends React.Component {

componentWillMount() {
store.subscribe(() => this.setState(store.getState()));
// subscription takes place after Redux store initialization action
// so listener won't update component's initial state -
// the app state needs to be synchronized manually
this.setState(store.getState());
}

render() {
Expand Down