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
-
Hello,
I'm puzzled why in the following example, we have reactivity with
State2
but notState1
: when you press a button,State1
line doesn't change, butState2
line does.In other words, when we
setState1
with a field inside a class, it doesn't trigger reactivity, but when wesetState2
with a method call on this class, which returns a newly constructed object, it does?Beta Was this translation helpful? Give feedback.
All reactions