Redux state lost when moving from one module to another module

Viewed 211

I am using react, redux, react redux with redux dynamic module. For loading modules, I am using the dynamic module loader. After loading the modules, when I move from one module to another, the state has been lost. I don't know why. I cannot utilize the redux feature. Whenever I move from one module to another, I lost state.

https://redux-dynamic-modules.js.org/#/reference/DynamicModuleLoader

See the image. Here I am changing routing. Whenever I change the route, the state has been added and removed. The old state didn't retain.

Bug Image

1 Answers

Sorry, the mistake is mine. Dynamic Module Loader concept is "When component is unmounted, the module will be removed from the store and the state will be cleaned up". So the logic is working as expected. I have used moduleStore.addModule(createModuleA()); instead of dynamic module loader. The redux concept is working as expected.

Related