Replies: 1 comment 1 reply
-
|
You are assigning the same reference. It thinks it hasn't changed. We do equality checks on state changes which means they don't directly support mutation. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm puzzled why in the following example, we have reactivity with
State2but notState1: when you press a button,State1line doesn't change, butState2line does.In other words, when we
setState1with a field inside a class, it doesn't trigger reactivity, but when wesetState2with a method call on this class, which returns a newly constructed object, it does?Beta Was this translation helpful? Give feedback.
All reactions