In `Transferring Props` guide, `Manual Transfer` section will lead an error
```c var FancyCheckbox = React.createClass({ render: function() { var fancyClass = this.props.checked ? 'FancyChecked' : 'FancyUnchecked'; return ( <div className={fancyClass} onClick={this.props.onClick}> {this.props.children} </div> ); } }); React.render( <FancyCheckbox checked={true} onClick={console.log}> Hello world! </FancyCheckbox>, document.body ); ``` When click `Hello world!` will lead a `Uncaught TypeError: Illegal invocation` error
张敏 committed
Dec 3, 2014 at 17:28 UTC
218a9ae74db26c1976d027ae6116ba8e0a943049
1 file changed
+1
-1
docs/docs/06-transferring-props.md
+1
-1
@@ -38,7 +38,7 @@ var FancyCheckbox = React.createClass({
38
}
39
});
40
React.render(
41
- <FancyCheckbox checked={true} onClick={console.log}>
41
+ <FancyCheckbox checked={true} onClick={console.log.bind(console)}>
42
Hello world!
43
</FancyCheckbox>,
44
document.body