Me gustaría agregar react-native-reanimated a mi proyecto, seguí la guía de instalación y al momento de agregar el complemento para Babel, recibo un error al iniciar la aplicación:
error: index.js: [BABEL] W:\folders\project\index.js: Unknown option: .pre. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options. Estoy usando un Android device y, por lo tanto, habilité Hermes y creé el método en MainApplication. ¿Como puedó resolver esté problema? ¿Tengo que publicar un problema en GitHub?
babel.config.js
module.exports = { presets: [ 'module:metro-react-native-babel-preset', 'react-native-reanimated/plugin', ], };dependencias
"react": "17.0.1", "react-native": "0.64.1", "react-native-gesture-handler": "^1.10.3", "react-native-reanimated": "2.3.0-beta.1", "metro-react-native-babel-preset": "^0.64.0",Solución probada:
react-native start --reset-cache .Tuve el mismo problema y luego me di cuenta de que debería estar en los plugins , no en los presets . Simplemente mueva 'react-native-reanimated/plugin' a los complementos:
module.exports = { presets: [ 'module:metro-react-native-babel-preset', - 'react-native-reanimated/plugin', ], + plugins: [ + 'react-native-reanimated/plugin' + ], }