I know that setting the displayName
is sometimes required especially when you're dealing with production builds. I want to know how to set it using my functional component - is it possible/allowed?
Here's what I've got in my class component:
const MyComponent = React.createClass({
displayName: 'HeyHey',
render: function() {
console.log(this.displayName);
}
});
How do I do the same thing inside a stateless component?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…