Estoy tratando de actualizar la biblioteca react-text-mask a Babel 7 y React 17 .
Para eso bifurqué: https://github.com/text-mask/text-mask
aquí: https://github.com/tlg-265/react-text-mask-react-17
y luego traté de actualizar Babel con el siguiente comando:
$ npx babel-upgrade --writePuedes instalarlo fácilmente haciendo esto:
$ git clone https://github.com/tlg-265/react-text-mask-react-17 $ cd react-text-mask-react-17 $ npm iMi problema es: Cuando lo ejecuto con:
$ npm run react:devme sale este error:
Support for the experimental syntax 'jsx' isn't currently enabledcomo se puede ver aquí:
ERROR in ./react/example/index.js Module build failed: SyntaxError: C:\react-text-mask-react-17\react\example\index.js: Support for the experimental syntax 'jsx' isn't currently enabled (6:3): 4 | 5 | ReactDOM.render( > 6 | <App/>, | ^ 7 | document.querySelector('#content') 8 | ) 9 | Add @babel/preset-react (https://git.io/JfeDR) to the 'presets' section of your Babel config to enable transformation. If you want to leave it as-is, add @babel/plugin-syntax-jsx (https://git.io/vb4yA) to the 'plugins' section to enable parsing. at instantiate (C:\react-text-mask-react-17\node_modules\@babel\parser\lib\index.js:72:32) at constructor (C:\react-text-mask-react-17\node_modules\@babel\parser\lib\index.js:358:12) at Parser.raise (C:\react-text-mask-react-17\node_modules\@babel\parser\lib\index.js:3334:19) at Parser.expectOnePlugin (C:\react-text-mask-react-17\node_modules\@babel\parser\lib\index.js:3391:18) at Parser.parseExprAtom (C:\react-text-mask-react-17\node_modules\@babel\parser\lib\index.js:12969:18) at Parser.parseExprSubscripts (C:\react-text-mask-react-17\node_modules\@babel\parser\lib\index.js:12539:23) at Parser.parseUpdate (C:\react-text-mask-react-17\node_modules\@babel\parser\lib\index.js:12518:21) at Parser.parseMaybeUnary (C:\react-text-mask-react-17\node_modules\@babel\parser\lib\index.js:12489:23) at Parser.parseMaybeUnaryOrPrivate (C:\react-text-mask-react-17\node_modules\@babel\parser\lib\index.js:12283:61) at Parser.parseExprOps (C:\react-text-mask-react-17\node_modules\@babel\parser\lib\index.js:12290:23) @ multi main webpack: Failed to compile.¿Alguna idea sobre cómo hacer que funcione?
Mi sistema es el siguiente:
$ node -v v12.16.1 $ npm -v 6.14.8¡Gracias!