We're a place where coders share, stay up-to-date and grow their careers.
Any idea why React.memo causes Unknown in devtools when passing the function definition itself rather than the exported variable?
Unknown
Good question! It's because the function that gets passed into React.memo is anonymous, so dev tools doesn't know what to call it even though the component itself is called Header.
React.memo
Header
Oh that makes perfect sense!
Any idea why React.memo causes
Unknown
in devtools when passing the function definition itself rather than the exported variable?Good question! It's because the function that gets passed into
React.memo
is anonymous, so dev tools doesn't know what to call it even though the component itself is calledHeader
.Oh that makes perfect sense!