Closed bertolaz closed 2 years ago
Ah yes, how unexpected :)
It looks like the serializer will use the parameterless constructor if it is public and the parameterised one if it is private. If you want the parameterless one to be public then decorate the parameterised one with [JsonConstructor]
Hi, I'm experiencing the following issue when using Redux Dev Tools. If I press the "Go Back" button to undo my actions, the State of my component resets directly to its initial state. Example: Starting from the initial state (ClickCount = 0) I click several times (eg .7) the IncrementCount Button. ClickCount now is 7. If I press once the "Go Back" button on the Redux Dev Tools, ClickCount is now 0.
This is the configuration of my CounterState
However, if if the Constructor that is required for creating the inital state is marked as "private" (as shown in the Tutorial) everything works as expected.
The tutorial states the following: "A parameterless constructor is required on state for determining the initial state, and can be private or public."