Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
gaearon opened this issue Apr 10, 2020 · 5 comments · Fixed by #19556
Closed

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

gaearon opened this issue Apr 10, 2020 · 5 comments · Fixed by #19556

Comments

@gaearon
Copy link
Collaborator

gaearon commented Apr 10, 2020

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.

@gaearon gaearon added Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug Component: Developer Tools Type: Enhancement and removed Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug labels Apr 10, 2020
@gaearon
Copy link
Collaborator Author

gaearon commented Apr 10, 2020

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
Copy link
Contributor

hanq08 commented Apr 16, 2020

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
Copy link
Contributor

bvaughn commented Apr 16, 2020

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

@stale
Copy link

stale bot commented Jul 18, 2020

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!

@stale stale bot added the Resolution: Stale Automatically closed due to inactivity label Jul 18, 2020
@eps1lon
Copy link
Collaborator

eps1lon commented Jul 19, 2020

bump

@stale stale bot removed the Resolution: Stale Automatically closed due to inactivity label Jul 19, 2020
@bvaughn bvaughn closed this as completed Aug 7, 2020
@bvaughn bvaughn reopened this Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants