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