Skip to content

Instantly share code, notes, and snippets.

@ryanflorence
Created November 26, 2014 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanflorence/3c4597c1e95b3fd3c9e1 to your computer and use it in GitHub Desktop.
Save ryanflorence/3c4597c1e95b3fd3c9e1 to your computer and use it in GitHub Desktop.
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