File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ const CodeMirror = createReactClass({
17
17
className : PropTypes . any ,
18
18
codeMirrorInstance : PropTypes . func ,
19
19
defaultValue : PropTypes . string ,
20
+ name : PropTypes . string ,
20
21
onChange : PropTypes . func ,
21
22
onCursorActivity : PropTypes . func ,
22
23
onFocusChange : PropTypes . func ,
@@ -41,6 +42,9 @@ const CodeMirror = createReactClass({
41
42
} ,
42
43
componentWillMount ( ) {
43
44
this . componentWillReceiveProps = debounce ( this . componentWillReceiveProps , 0 ) ;
45
+ if ( this . props . path ) {
46
+ console . error ( 'Warning: react-codemirror: the `path` prop has been changed to `name`' ) ;
47
+ }
44
48
} ,
45
49
componentDidMount ( ) {
46
50
const codeMirrorInstance = this . getCodeMirrorInstance ( ) ;
@@ -117,7 +121,7 @@ const CodeMirror = createReactClass({
117
121
< div className = { editorClassName } >
118
122
< textarea
119
123
ref = { ref => this . textareaNode = ref }
120
- name = { this . props . path }
124
+ name = { this . props . name || this . props . path }
121
125
defaultValue = { this . props . value }
122
126
autoComplete = "off"
123
127
autoFocus = { this . props . autoFocus }
You can’t perform that action at this time.
0 commit comments