dillon1000/react
Commit
Browse files honor displayName set on ForwardRef if available (#13615)
* add failing test * honor displayName set on ForwardRef if available Since React.forwardRef returns a component object, some users (including styled-components and react-native) are starting to decorate them with various statics including displayName. This adjusts React's various name-getters to honor this if set and surface the name in warnings and hopefully DevTools. * fix typing * Refine later
Changed paths3 files
First-parent comparisonpackages/react/src/ReactElementValidator.js ModifiedM packages/react/src/__tests__/forwardRef-test.js ModifiedM packages/shared/getComponentName.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…