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

25 lines
472 B
JavaScript
Raw Normal View History

2016-06-27 20:03:22 +00:00
import React, { PropTypes } from 'react';
2016-06-23 22:29:55 +00:00
class Preview extends React.Component {
componentDidMount() {
}
render() {
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-06-27 20:03:22 +00:00
Preview.propTypes = {
content: PropTypes.string.isRequired
};
2016-06-23 22:29:55 +00:00
export default Preview;