Skip to content

DevTools: Memo(ForwardRef()) and "Rendered By" List #18571

@gaearon

Description

@gaearon
Collaborator

If you have memo(forwardRef(X)), then the inner component won't have a "rendered by" list. This is because it technically doesn't have an owner. It is artificial.

I think we should ideally set up _debugOwner for these Fibers in DEV just so existing tooling can find them. Or special case them in DevTools.

Activity

gaearon

gaearon commented on Apr 10, 2020

@gaearon
CollaboratorAuthor

It's especially bad because it breaks the "rendered by" chain for inner trees. They "stop" at the inner memo() content (unless it's SimpleMemo).

I think this might also be why RN inspector sometimes shows trees that stop abruptly without going all the way up to the root.

hanq08

hanq08 commented on Apr 16, 2020

@hanq08
Contributor

I think this not only happens in forwardRef, any non simple component wrapped in memo will have this issue. for example memo(class Component).

I'd like to work on this. I think the issue lies here potentially https://github.com/facebook/react/blob/master/packages/react-reconciler/src/ReactFiberBeginWork.new.js#L421 Let me know if that's ok thanks.

bvaughn

bvaughn commented on Apr 16, 2020

@bvaughn
Contributor

@hanq08 If you're interested in working on this, we'd welcome a PR.

stale

stale commented on Jul 18, 2020

@stale

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

eps1lon

eps1lon commented on Jul 19, 2020

@eps1lon
Collaborator

bump

reopened this on Aug 7, 2020
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

      Participants

      @bvaughn@gaearon@hanq08@eps1lon

      Issue actions

        DevTools: Memo(ForwardRef()) and "Rendered By" List · Issue #18571 · facebook/react