I use the code below to set default props on a React component but it doesn\'t work. In the render() method, I can see the output \"undefined props\" was printe
render()
class Example extends React.Component { render() { return {this.props.text}; } } Example.defaultProps = { text: 'yo' };