Created
September 25, 2014 06:28
-
-
Save cjohansen/e69d20987d575f449813 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
| function createSearchBox(data, service) { | |
| var Input = React.createComponent({ | |
| render: function () { | |
| return React.DOM.input({ | |
| onClick: function () { | |
| service.doStuff(); | |
| } | |
| }); | |
| } | |
| }); | |
| var Other = React.createComponent({ | |
| render: function () { | |
| // ... | |
| } | |
| }); | |
| var SearchBox = React.createComponent({ | |
| render: function () { | |
| return React.DOM.div({}, | |
| Input(this.props), | |
| Other(this.props)); | |
| } | |
| }); | |
| return SearchBox(data); | |
| } | |
| var search = createSearchBox(service); | |
| // ... | |
| search.setProps({...}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment