The error "Cannot read property 'makeMutable' of undefined" in your screenshot is a React Native Reanimated setup/configuration issue—not a problem with your code imports.
I added the following to my
babel.config.js: plugins: ['react-native-reanimated/plugin']
I then restarted my system.
Then I did:
npm i react-native-reanimated
if you are using yarn you can use yarn add react-native-reanimated
After that I ran :
npm run start -- --reset-cache
==============================================================
solution
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
// ...other plugins
'react-native-reanimated/plugin', // <-- MUST be last
],
};
================
Create/Update metro.config.js
This is critical for Reanimated 3.x and often missed:
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const { wrapWithReanimatedMetroConfig } = require('react-native-reanimated/metro-config');
const config = {};
module.exports = wrapWithReanimatedMetroConfig(
mergeConfig(getDefaultConfig(__dirname), config)
);
================================================
Stop Metro bundler if running
cd android && ./gradlew clean && cd ..
npx react-native start --reset-cache
npx react-native run-android
============or===============
# Clean node_modules (recommended)
rm -rf node_modules package-lock.json
npm install
# Clean Android build
cd android
./gradlew clean
cd ..
# Start with clean cache
npx react-native start --reset-cache
# In a new terminal
npx react-native run-android
===============================================
npm install react-native-reanimated@3.14.0 --save
Top comments (0)