While trying to migrate from React to preact, we noticed some mounting/rerendering issues;
Not sure if you consider this as a bug or not, but compared to react there's a difference in the way preact decides which component got dropped and which one got reordered when two siblings have the same type but not the same children.
Code examples are clearer:
Notice that the subcomponent in the preact version is constantly remounting, if we hide/show the previous <div> while it's mounted only once in React. I found a workaround by setting a key prop to identify the <div>s.
While trying to migrate from React to preact, we noticed some mounting/rerendering issues;
Not sure if you consider this as a bug or not, but compared to react there's a difference in the way preact decides which component got dropped and which one got reordered when two siblings have the same type but not the same children.
Code examples are clearer:
Notice that the subcomponent in the preact version is constantly remounting, if we hide/show the previous
<div>while it's mounted only once in React. I found a workaround by setting akeyprop to identify the<div>s.