Skip to content

Instantly share code, notes, and snippets.

@cjohansen
Created September 25, 2014 06:28
Show Gist options
  • Select an option

  • Save cjohansen/e69d20987d575f449813 to your computer and use it in GitHub Desktop.

Select an option

Save cjohansen/e69d20987d575f449813 to your computer and use it in GitHub Desktop.
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