Skip to content

Support enter & leave handlers for traverseFibers #18

@Asuka109

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.

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