react-codemirror
react-codemirror copied to clipboard
codemirror.js:5921 Uncaught TypeError: textarea.getAttribute is not a function
React-Codemirror 0.2.6 doesn't work with React 0.13.3 in last Chrome version
options.autofocus = hasFocus == textarea || textarea.getAttribute("autofocus") != null && hasFocus == document.body;
It looks like textarea does't exist
I'm having the same problem — React-Codemirror 0.2.6, React 0.13.3, Chrome. Any tips on how to resolve?
Top of stack trace is as follows:
CodeMirror.fromTextArea @ codemirror.js:5942
CodeMirror_componentDidMount @ Codemirror.js:30
notifyAll @ CallbackQueue.js:68
close @ ReactReconcileTransaction.js:81
closeAll @ Transaction.js:207
perform @ Transaction.js:148
batchedMountComponentIntoNode @ ReactMount.js:269
perform @ Transaction.js:134
batchedUpdates @ ReactDefaultBatchingStrategy.js:66
batchedUpdates @ ReactUpdates.js:
110_renderNewRootComponent @ ReactMount.js:404
ReactMount__renderNewRootComponent @ ReactPerf.js:70
render @ ReactMount.js:493
React_render @ ReactPerf.js:70163
../editor.jsx @ app.jsx:99
s @ _prelude.js:1
e @ _prelude.js:1
(anonymous function) @ _prelude.js:1
codemirror.js:5942 is this:
textarea.getAttribute("autofocus") != null && hasFocus == document.body
Thanks!
Fixed by upgrading to react@~0.14.2.
(Underlying Codemirror module needs React 14 or 15, so maybe ReactCodemirror also needs this dependency, as well?)