Answer the question
In order to leave comments, you need to log in
How to pass data to redux on server side render?
nextjs. On the index.js route page, I call an action through getInitialProps that updates the redux store.
Index.getInitialProps = ({ reduxStore }) => {
reduxStore.dispatch(toggleType('woman'));
return { };
};
const mapStateToProps = state => ({
type: state.app.type,
});
export default connect(
mapStateToProps
)(withRouter(HeaderContainer));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question