Open clayrisser opened 6 years ago
Why are we subscribing to the persistor after the component renders? This breaks redux-persist for isomorphic applications because the server does not rerender since the html has already been sent to the client.
componentDidMount() { this._unsubscribe = this.props.persistor.subscribe( this.handlePersistorState ) this.handlePersistorState() }
Subscribing to the persistor before the first (and only) render enables proper isomorphic support.
componentWillMount() { this._unsubscribe = this.props.persistor.subscribe( this.handlePersistorState ) this.handlePersistorState() }
https://github.com/rt2zz/redux-persist/blob/master/src/integration/react.js#L27-L32
If you want this fix immediately, you can add the following to the dependencies section of your package.json file.
dependencies
package.json
"redux-persist": "git+https://github.com/codejamninja/redux-persist.git#npm"
Why are we subscribing to the persistor after the component renders? This breaks redux-persist for isomorphic applications because the server does not rerender since the html has already been sent to the client.
Subscribing to the persistor before the first (and only) render enables proper isomorphic support.
https://github.com/rt2zz/redux-persist/blob/master/src/integration/react.js#L27-L32