Skip to content

How to traverse the React tree? #12640

@gregberge

Description

@gregberge

I would like to propose to add a walkTree method in React. Today a lot of libraries relies on walking the React tree for SSR. It is used to preload data, styles or whatever.

I am asking because I found a bug in Loadable Components and I fixed it, but the bug is also in React Apollo and probably in other libraries that use this strategy.

I have several questions:

  • Is walkTree the good strategy? If not can you tell me how to do it?
  • If walkTree is the good strategy, could you maintain it and expose it in React or another package?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions