Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
var SomeReactComponentInEmber = Ember.Component.extend({
renderReact () {
var el = React.createElement(MyComponent, {
onSave: this.handleSave
});
React.render(el, this.get('element'));
}.on('didInsertElement'),
teardownReact () {
React.unmountComponentAtNode(this.get('element'));
}.on('willDestroyElement'),
handleSave (data) {
this.sendAction('save', data);
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment