add proptypes to editor and preview
This commit is contained in:
parent
f60a7e845d
commit
3ab89b4cae
2 changed files with 12 additions and 2 deletions
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue