react-bounds icon indicating copy to clipboard operation
react-bounds copied to clipboard

Component name is not preserved when wrapping

Open ashbrowning opened this issue 8 years ago • 0 comments

When wrapping a component, the name of the component is not carried through to the wrapped component. This means that when snapshot testing or viewing stack traces, a wrapped component will always have the name of Component rather than the original (and less generic) name, which can hamper debugging.

To fix, the name of the component can be assigned to the displayName property of the returned Wrap component. Something similar is done in the isomorphic-style-loader

ashbrowning avatar Dec 19 '17 14:12 ashbrowning