erikras / react-redux-universal-hot-example

A starter boilerplate for a universal webapp using express, react, redux, webpack, and react-transform
MIT License
12.01k stars 2.5k forks source link

How to maintain the state of component while switching from container to components #1358

Closed harshjulka closed 6 years ago

harshjulka commented 7 years ago

When I am switching from one component to another component i.e board component and card component, The state I have in board component gets vanish when I call card component from board component.

Do we have any way to maintain the state or can we getState from inside the component. Please help me in this.

OKNoah commented 7 years ago

If there is state needed in more than one component, create a Redux module and store the state there. See src/redux/modules for examples :)

OKNoah commented 6 years ago

@harshjulka Hope this was helpful!