forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
findDOMNode: Remove return pointer mutation (facebook#20272)
The last step of the `findDOMNode` algorithm is a search of the current tree. When descending into a child node, it mutates `child.return` so that it points to the current fiber pair, instead of a work-in-progress. This can cause bugs if `findDOMNode` is called at the wrong time, like in an interleaved event. For this reason (among others), you're not suppposed to use `findDOMNode` in Concurrent Mode. However, we still have some internal uses that we haven't migrated. To reduce the potential for bugs, I've removed the `.return` pointer assignment in favor of recursion.
- Loading branch information
Showing
1 changed file
with
37 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters