|
1 | 1 | const React = require('react'); |
2 | 2 | const ReactDOM = require('react-dom'); |
3 | 3 | const findDOMNode = ReactDOM.findDOMNode; |
| 4 | +const PropTypes = require('prop-types'); |
4 | 5 | const className = require('classnames'); |
5 | 6 | const debounce = require('lodash.debounce'); |
| 7 | +const createReactClass = require('create-react-class'); |
6 | 8 |
|
7 | 9 | function normalizeLineEndings (str) { |
8 | 10 | if (!str) return str; |
9 | 11 | return str.replace(/\r\n|\r/g, '\n'); |
10 | 12 | } |
11 | 13 |
|
12 | | -const CodeMirror = React.createClass({ |
| 14 | +const CodeMirror = createReactClass({ |
13 | 15 | propTypes: { |
14 | | - className: React.PropTypes.any, |
15 | | - codeMirrorInstance: React.PropTypes.func, |
16 | | - defaultValue: React.PropTypes.string, |
17 | | - onChange: React.PropTypes.func, |
18 | | - onFocusChange: React.PropTypes.func, |
19 | | - onScroll: React.PropTypes.func, |
20 | | - options: React.PropTypes.object, |
21 | | - path: React.PropTypes.string, |
22 | | - value: React.PropTypes.string, |
23 | | - preserveScrollPosition: React.PropTypes.bool, |
| 16 | + className: PropTypes.any, |
| 17 | + codeMirrorInstance: PropTypes.func, |
| 18 | + defaultValue: PropTypes.string, |
| 19 | + onChange: PropTypes.func, |
| 20 | + onFocusChange: PropTypes.func, |
| 21 | + onScroll: PropTypes.func, |
| 22 | + options: PropTypes.object, |
| 23 | + path: PropTypes.string, |
| 24 | + value: PropTypes.string, |
| 25 | + preserveScrollPosition: PropTypes.bool, |
24 | 26 | }, |
25 | 27 | getDefaultProps () { |
26 | 28 | return { |
|
0 commit comments