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