-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Exclude forwardRef and memo from stack frames #18559
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit e1885ab:
|
You kept forwardRef? |
@@ -121,7 +121,7 @@ export function describeUnknownElementTypeFrameInDEV( | |||
case REACT_FORWARD_REF_TYPE: | |||
return describeFunctionComponentFrame(type.render, source, ownerFn); | |||
case REACT_MEMO_TYPE: | |||
return describeFunctionComponentFrame(type.type, source, ownerFn); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was also a bug because the inner one might not be a function.
<Outer inner={false} middle={false} outer={false} />, | ||
<div> | ||
<Outer inner={false} middle={false} outer={false} /> | ||
</div>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warning no longer includes any stack because there's only a Memo. This triggers our internal warning about not expecting a stack on the warning. However, that's not realistic so let's test it with a stack.
I kept SimpleMemoComponent and ForwardRef in the Fiber describing thing but they just describe their function name. It's only one Fiber for both the function and wrapper. I removed Memo because it's not the actual function, the function is represented by its own Fiber as a child so it's already there. For elements I was already doing this by only naming the function. |
We can't patch the row. We could give these their own "built-in" stack frame since they're conceptually HoCs. However, from a debugging perspective this is not very useful meta data and quite noisy. So I'm just going to exclude them.
We can't patch the row with the new trick. So they won't be called
Memo(Name)
in the stack anymore.We could give these their own "built-in" stack frame since they're conceptually HoCs. I.e.
However, from a debugging perspective this is not very useful meta data and quite noisy. So I'm just going to exclude them.