File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ const CodeMirror = createReactClass({
1717 className : PropTypes . any ,
1818 codeMirrorInstance : PropTypes . func ,
1919 defaultValue : PropTypes . string ,
20+ name : PropTypes . string ,
2021 onChange : PropTypes . func ,
2122 onCursorActivity : PropTypes . func ,
2223 onFocusChange : PropTypes . func ,
@@ -41,6 +42,9 @@ const CodeMirror = createReactClass({
4142 } ,
4243 componentWillMount ( ) {
4344 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+ }
4448 } ,
4549 componentDidMount ( ) {
4650 const codeMirrorInstance = this . getCodeMirrorInstance ( ) ;
@@ -117,7 +121,7 @@ const CodeMirror = createReactClass({
117121 < div className = { editorClassName } >
118122 < textarea
119123 ref = { ref => this . textareaNode = ref }
120- name = { this . props . path }
124+ name = { this . props . name || this . props . path }
121125 defaultValue = { this . props . value }
122126 autoComplete = "off"
123127 autoFocus = { this . props . autoFocus }
You can’t perform that action at this time.
0 commit comments