add proptypes to editor and preview

This commit is contained in:
catarak 2016-06-27 16:03:22 -04:00
parent f60a7e845d
commit 3ab89b4cae
2 changed files with 12 additions and 2 deletions

View file

@ -1,4 +1,4 @@
import React from 'react'; import React, { PropTypes } from 'react';
import CodeMirror from 'codemirror'; import CodeMirror from 'codemirror';
import 'codemirror/mode/javascript/javascript'; import 'codemirror/mode/javascript/javascript';
import 'codemirror/addon/selection/active-line'; import 'codemirror/addon/selection/active-line';
@ -40,4 +40,10 @@ class Editor extends React.Component {
} }
} }
Editor.propTypes = {
content: PropTypes.string.isRequired,
updateFile: PropTypes.func.isRequired,
fontSize: PropTypes.number.isRequired
};
export default Editor; export default Editor;

View file

@ -1,4 +1,4 @@
import React from 'react'; import React, { PropTypes } from 'react';
class Preview extends React.Component { class Preview extends React.Component {
componentDidMount() { componentDidMount() {
@ -17,4 +17,8 @@ class Preview extends React.Component {
} }
} }
Preview.propTypes = {
content: PropTypes.string.isRequired
};
export default Preview; export default Preview;