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
Accessors (getters/setters) Are Not Copied After immer@10 Update
Description:
Starting with Immer v10, the library stopped copying accessors (i.e., getters/setters) during object updates in drafts. This has caused issues for objects in my state that rely on getters, as these accessors are removed after the next state update due to Immer's behavior.
Proposed Solution:
Would it be possible to introduce new Immer settings that can be passed through configureStore, or perhaps export useStrictShallowCopy alongside the other Immerexports in Redux Toolkit, so this behavior can be enabled as an opt-in feature?
The text was updated successfully, but these errors were encountered:
No, this isn't something we'd want to support. Your state should be plain objects that don't rely on getters in the first place, and this isn't something we'd want to provide as an option in configureStore.
Just out of curiosity, what are you doing with your state objects that has you putting getters in there? And how are you adding getters to the objects?
Issue
Accessors (
getters/setters
) Are Not Copied Afterimmer@10
UpdateDescription:
Starting with
Immer v10
, the library stopped copying accessors (i.e.,getters/setters
) during object updates in drafts. This has caused issues for objects in my state that rely ongetters
, as these accessors are removed after the next state update due to Immer's behavior.Proposed Solution:
Would it be possible to introduce new
Immer
settings that can be passed throughconfigureStore
, or perhapsexport useStrictShallowCopy
alongside the other Immerexports in Redux Toolkit, so this behavior can be enabled as an opt-in feature?The text was updated successfully, but these errors were encountered: