Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

findDOMNode: Remove return pointer mutation #20272

Merged
merged 1 commit into from
Nov 16, 2020

Commits on Nov 16, 2020

  1. findDOMNode: Remove return pointer mutation

    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.
    acdlite committed Nov 16, 2020
    Configuration menu
    Copy the full SHA
    945a6f4 View commit details
    Browse the repository at this point in the history