Created
June 12, 2016 00:45
-
-
Save talkol/31ee848bbb034aa9fcfdaa18fbf985cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var React = require('React'); | |
| var ReboundRenderer = React.createClass({ | |
| propTypes: { | |
| boundTo: React.PropTypes.number.isRequired, | |
| render: React.PropTypes.func.isRequired, | |
| }, | |
| shouldComponentUpdate: function(nextProps): boolean { | |
| return nextProps.boundTo !== this.props.boundTo; | |
| }, | |
| render: function(): ReactElement<any> { | |
| console.log('ReboundRenderer render() boundTo=' + this.props.boundTo); | |
| return this.props.render(this.props.boundTo); | |
| }, | |
| }); | |
| module.exports = ReboundRenderer; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment