Skip to content

Commit ea31cf9

Browse files
acdliteAndyPengc12
authored andcommitted
Don't modify keyPath until right before recursive renderNode call (facebook#27366)
Currently, if a component suspends, the keyPath has already been modified to include the identity of the component itself; the path is set before the component body is called (akin to the begin phase in Fiber). An accidental consequence is that when the promise resolves and component is retried, the identity gets appended to the keyPath again, leading to a duplicate node in the path. To address this, we should only modify contexts after any code that may suspend. For maximum safety, this should occur as late as possible: right before the recursive renderNode call, before the children are rendered. I did not add a test yet because there's no feature that currently observes it, but I do have tests in my other WIP PR for useFormState: facebook#27321
1 parent c9f6724 commit ea31cf9

File tree

1 file changed

+94
-19
lines changed

1 file changed

+94
-19
lines changed

0 commit comments

Comments
 (0)