Open Archmonger opened 9 months ago
This might be related to a bug I've seen where nested children are marked as "rendered" and then if there's subsequent updates to their state they get skipped. Changing the rendering order can expose or hide the bug.
If I had to guess, an example of this: Button alters state on child and triggers callback on parent Parent alters parameter passed to child based on callback Child doesn't render with new parameter because it was already rendered.
This can create a case where subsequent triggers to the child fail because the component is unmounted
I'm writing this off the top of my head, I don't have a reproducible state off hand.
Current Situation
This issue was first discovered while trying to develop https://github.com/reactive-python/reactpy-django/pull/226
I created a component that simulates a
list
of conditionally rendered children. Each child in the list contains a uniquekey
. However, theuse_effect
unmount method does not always appear to be called when the component is dismounted.Here is a minimum viable example:
You can demo this by adding a bunch of children, then removing them. If you look at terminal, you'll notice that
unmount
was only called once despite multiple children being unloaded.Proposed Actions
No response