p5.js-web-editor/shared/components/Preview/Preview.jsx

21 lines
436 B
React
Raw Normal View History

2016-05-05 23:48:26 +02:00
import React from 'react';
import ReactDOM from 'react-dom';
2016-05-05 23:48:26 +02:00
class Preview extends React.Component {
componentDidMount() {
2016-05-10 00:28:38 +02:00
console.log(ReactDOM.findDOMNode(this));
}
2016-05-05 23:48:26 +02:00
render() {
2016-05-10 00:28:38 +02: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 23:48:26 +02:00
}
export default Preview;