DEV Community

Discussion on: React DevTools and Unknown Components

Collapse
 
johansedgeware profile image
Johan • Edited

How I write a HOC so that names are preserved in Devtools:

 export default WrapperComponent => function withWrapperComponent(props) {
     return (<WrapperComponent {...props} />)
 }

My HOC will now show up in Devtools like withWrapperComponent

We don't have to use anonymous functions all the time