p5.js-web-editor/client/modules/IDE/components/Preview.jsx

21 lines
436 B
React
Raw Normal View History

2016-05-05 21:48:26 +00:00
import React from 'react';
import ReactDOM from 'react-dom';
2016-05-05 21:48:26 +00:00
class Preview extends React.Component {
componentDidMount() {
2016-05-09 22:28:38 +00:00
console.log(ReactDOM.findDOMNode(this));
}
2016-05-05 21:48:26 +00:00
render() {
2016-05-09 22:28:38 +00:00
return (
<div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.0/p5.min.js"></script>
<script type="text/javascript">
{this.props.content}
</script>
</div>
);
}
2016-05-05 21:48:26 +00:00
}
export default Preview;