Skip to content

Rendered markup roots should be added to ReactMount node cache #2365

Closed
@syranide

Description

@syranide

ReactMount caches all children for each parent it visits, this avoids worst-case exponential cost. However, use of ReactDOMIDOperations for updates forces ReactMount to populate the cache with the previous children.

If a newly rendered node needs to be found, then "the children of the parent" of "the newly rendered root" has to be re-traversed as it does not exist in the node cache. Since it's guaranteed that all the siblings of newly rendered roots are cached and that we have a reference to the node, it's trivial to manually add it to the node cache which should avoid "double-traversals" entirely.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions