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
In a reaction, old value is exposed as a non-readonly type
Non-readonly type allows a reaction code to misuse the old value;
One example of misuse is assigning the old value to a new value
As a result, when doing a comparison between a stored old state and a new one, e.g. newState.someprop == oldState.someprop, it will return true newState.someprop has the same reference as oldState.
====
Should this be solved with a programmatic approach: setting the type to Readonly?
Or, should this be solved with a "user manual" approach e.g. by providing FAQs, guide, etc?
The text was updated successfully, but these errors were encountered:
newState.someprop == oldState.someprop
, it will return truenewState.someprop
has the same reference asoldState
.====
Should this be solved with a programmatic approach: setting the type to Readonly?
Or, should this be solved with a "user manual" approach e.g. by providing FAQs, guide, etc?
The text was updated successfully, but these errors were encountered: