Last active
August 29, 2015 14:09
-
-
Save rarous/62654981ae61c9d04a86 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 DeeplyNestedComponent = React.createClass({ | |
contextTypes: { | |
updateStream: React.PropTypes.object | |
}, | |
handleChange: e => { | |
e.preventDefault(); | |
this.context.updateStream.emit(e.target.value); | |
}, | |
// ... | |
}); | |
var RootComponent = React.createClass({ | |
render: () => { | |
var context = { updateStream: this.props.updateStream }; | |
var children = React.withContext(context, () => { | |
}); | |
return <div>{children}</div>; | |
} | |
}); | |
var emmiter = Kefir.emitter(); | |
var view = React.render(<RootComponent updateStream={emmiter} />, /*...*/); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment