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

Add SuspenseList to DevTools Element Names #19674

Closed
sebmarkbage opened this issue Aug 21, 2020 · 2 comments · Fixed by #19684
Closed

Add SuspenseList to DevTools Element Names #19674

sebmarkbage opened this issue Aug 21, 2020 · 2 comments · Fixed by #19684

Comments

@sebmarkbage
Copy link
Collaborator

sebmarkbage commented Aug 21, 2020

We have SuspenseList for the tree view but not when printing JSX.

When we fallthrough here we call getDisplayName with a symbol, because we assume that if it's not a string, then it's a function. We should be checking whether it is a function before calling getDisplayName.

Subsequently if we call getDisplayName with a symbol we get the error invalid value used as weak map key which messes up things after that. I think that's the actual cause of #19364

@bpernick
Copy link
Contributor

@sebmarkbage I'm happy to take this on if you like! Just to clarify, what would be the expected behavior of calling getDisplayNameForReactElement on a symbol? Returning 'Symbol'?

Also should we handle the case where it falls through and is neither a symbol nor a function? In this case should it simply return 'Anonymous'?

@bpernick
Copy link
Contributor

Sorry for any confusion earlier! I just took a stab at adding SuspenseList and adding a check to only pass functions into getDisplayName. (I've submitted my CLA)

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.

2 participants