← React Intermediate Questions - Set 12 Q120
What is the significance of the `displayName` property in React?
React Intermediate Questions - Set 12
Example
1
2
const Row = memo(function Row() { … });
Row.displayName = 'Row'; // DevTools shows "Row" instead of "Anonymous"
What to notice
- Cosmetic but valuable with HOCs, forwardRef and memo, which otherwise appear anonymised.
← Back to the question list