Skip to content

Instantly share code, notes, and snippets.

@zpao
Created April 17, 2014 18:16
Show Gist options
  • Save zpao/11002454 to your computer and use it in GitHub Desktop.
Save zpao/11002454 to your computer and use it in GitHub Desktop.
/** @jsx React.DOM */
var SWF = React.createClass({
componentDidMount: function() {
var newNode = document.createElement('div');
var myNode = this.getDOMNode();
myNode.appendChild(newNode);
swfobject.embedSWF(this.props.file, newNode);
},
render: function() {
return <div />;
}
});
React.renderComponent(<SWF file ="path/to/file.swf" />, document.body);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment