Skip to content

Support enter & leave handlers for traverseFibers #18

Description

@Asuka109

So that we can implement complex traversal logic, such as analyzing the route structure of React Router. It would look like this:

instrument(
  secure({
    onCommitFiberRoot(rendererID, root, _priority) {
      const returns: Fiber[] = [];
      traverseFiber(root.current, {
        enter: fiber => {
          // Do something with the fiber and returns.
          // ...

          returns.unshift(fiber);
        },
        leave: fiber => {
          returns.shift();
        }
      });
    }
  })
);

Or you can just assign it to me. I can take care of it.

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions