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

Bug: React DevTools ignores displayName on React.memo components #18146

Closed
lxender opened this issue Feb 27, 2020 · 2 comments
Closed

Bug: React DevTools ignores displayName on React.memo components #18146

lxender opened this issue Feb 27, 2020 · 2 comments
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@lxender
Copy link

lxender commented Feb 27, 2020

Components wrapped in React.memo don't have a display name in the "components" tab of React DevTools.

React version: 16.13

Steps To Reproduce

  1. create a component that uses React.memo
  2. name the component using "displayName"
  3. open DevTools
  4. the component will not use the name from step 2
const Test = React.memo(({ message }) => {
    return <h1>{message}</h1>;
});
Test.displayName = "Foo"; // Will be displayed as "Anonymous"

function App() {
    return (
        <Test message="Hi" />
    );
}

The current behavior

Memos ignore "displayName" in React DevTools

The expected behavior

Memos show "displayName" in React DevTools

@lxender lxender added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Feb 27, 2020
@lxender lxender changed the title Bug: React Devtools ignore displayName on React.memo components Bug: React DevTools ignores displayName on React.memo components Feb 27, 2020
@eps1lon
Copy link
Collaborator

eps1lon commented Feb 27, 2020

Looks like a duplicate of #18026

@lxender
Copy link
Author

lxender commented Feb 27, 2020

Oh yea, sorry

@lxender lxender closed this as completed Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

2 participants