I have a React (15.5.4) component with many children, some of which are HTML elements and some are other React components.
I\'m using server rendering and need the s
If you're using Babel, you can use this Babel plugin to automatically set the displayName
, so that child.type.displayName
will equal the string of whatever you've named the component:
https://www.npmjs.com/package/babel-plugin-add-react-displayname
It's easy to install and use, just read the directions and make sure to add the plugin name add-react-displayname
to your plugins array in your .babelrc
file.