You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.
When a component using withReducer is mounted the reducers should be attached then detached once unmounted.
Current Behaviour
A small percentage of the time when re-attaching the reducer the state becomes undefined and causes the selectors to throw an error.
Cannot read property 'value' of undefined
After further investigation this issue only occurs whilst the Redux Devtools plugin is enabled.
Context
Parts of our app (data tables, grids) require large state trees and are rarely used more than once so would benefit from a reusable HOC for detaching the reducer once the component unmounts.
Your Setup
Package Name
Version
React
17.0.1
@redux-dynostore/core
^3.1.0
@redux-dynostore/react-redux
^3.1.0
redux-dev-tools
2.17.0
The text was updated successfully, but these errors were encountered:
Thanks for having a look! I've just gave it another go and can confirm the problem is still occurring.
It typically works as expected the first time the reducer is attached/detached but then when it's re-attached i get the bug causing the undefined state in the selectors.
I have also confirmed in our own app that this only occurs when the Redux Devtool extention is enabled, if that's any use.
Is it a bug, feature request or question?
Bug
Which package(s) does this involve?
[@redux-dynostore/core, @redux-dynostore/react-redux]
Input Code
This implementation uses a simple
withReducer
HOC to attach and detach the provided reducers with the component.Code Sandbox
Expected Behaviour
When a component using
withReducer
is mounted the reducers should be attached then detached once unmounted.Current Behaviour
A small percentage of the time when re-attaching the reducer the state becomes
undefined
and causes the selectors to throw an error.After further investigation this issue only occurs whilst the Redux Devtools plugin is enabled.
Context
Parts of our app (data tables, grids) require large state trees and are rarely used more than once so would benefit from a reusable HOC for detaching the reducer once the component unmounts.
Your Setup
The text was updated successfully, but these errors were encountered: