dillon1000/react

Commit

Use both displayName and name in forwardRef/memo (#29625)

When defining a displayName on forwardRef/memo we forward that name to
the inner function.

We used to use displayName for this but in #29206 I switched this to use
`"name"`. That's because V8 doesn't use displayName, it only uses the
overridden name in stack traces. This is the only thing covered by our
tests for component stacks.

However, I realized that Safari only uses displayName and not the name.
So this sets both.
Browse files
Changed paths2 files
First-parent comparison
M packages/react/src/ReactForwardRef.js ModifiedM packages/react/src/ReactMemo.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…