Created
June 19, 2015 12:51
-
-
Save AllThingsSmitty/e78936c35bccb4378c20 to your computer and use it in GitHub Desktop.
Great way to wrap non-React UI elements that manage lists of items and leverage VDOM diffing
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
const SourceElement = React.createClass({ | |
componentDidMount: f() { | |
this.props.view.addSource(this.props.source); | |
}, | |
componentWillUnumount: f() { | |
this.props.view.removeSource(this.props.source); | |
}, | |
componentWillReceiveProps: f(nextProps) { | |
this.props.view.updateSource(nextProps.this.props.source); | |
}, | |
render: f() { | |
return null; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment