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
Removing of C does not cause remount of A and B.
Removing of B causes remount of C.
Removing of A causes remount of B and C.
This is actually native React behaviour - #546 (comment)
Expected behaviour:
Changes done of server side shall not remount still existing components on frontend.
Changes done on clientside shall follow default behaviour.
Current behaviour:
Changes done regardless of origin do follow the default behaviour.
How:
We can add key to the all elements without key(in autoWrap).
Key could be calculated as typename(proxykey) + counter(+hash from props) .
Key shall be calculated on hydrate stage.
In runtime we should compare rendered children with a hydrated ones (in autoWrap) - if types does not match - drop the generated keys. The new ones will be calculated on next hot-replace.
Pros:
This is actually the behaviour users expect
Cons:
We continue to deeply hack React.
The text was updated successfully, but these errors were encountered:
At this time this is not the goal of React Hot Loader to change the behaviour of React. If people want this kind of behaviour they can use "key". Wrapping it with custom key will introduce a lot of bugs for a minimal gain.
Having 3 elements:
Removing of C does not cause remount of A and B.
Removing of B causes remount of C.
Removing of A causes remount of B and C.
This is actually native React behaviour - #546 (comment)
Expected behaviour:
Changes done of server side shall not remount still existing components on frontend.
Changes done on clientside shall follow default behaviour.
Current behaviour:
Changes done regardless of origin do follow the default behaviour.
How:
key
to the all elements withoutkey
(in autoWrap).typename
(proxykey) + counter(+hash from props) .hydrated
ones (in autoWrap) - if types does not match - drop the generated keys. The new ones will be calculated on next hot-replace.Pros:
This is actually the behaviour users expect
Cons:
We continue to deeply hack React.
The text was updated successfully, but these errors were encountered: