-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Description
Steps to reproduce
- Go to this playground
- Click "Hide"
- A warning will be logged in the console
Description
In the example, a memo is created by the compiler where getCountCheckOwner() gets read.
The problem is that the children prop is read here (On getTagKey() called by removeTag()) during the removal of the tag when disposing.
This is not ok because at that point in time there's no Owner, so the memo created by reading children will never be disposed
Maybe it is
onCleanup()that should restore theOwner?
I don't know, but it wouldn't be enough to fix this situation anyway, since the cleanup would still be delayed (Potentially indefinitely)
Suggestion
I suggest changing that code as follows:
const tagProps = Object.fromEntries(
properties
.filter(k => k in tag.props)
.map(k => [k, tag.props[k]])
.sort()
);const tagProps = Object.fromEntries(
+ properties
+ .filter(k => k in tag.props)
+ .map(k => [k, tag.props[k]])
- Object.entries(tag.props)
- .filter(([k]) => properties.includes(k))
.sort()
);Metadata
Metadata
Assignees
Labels
No labels