Unable to resolve module react-native/Libraries/Animated/src/AnimatedEvent could not be found within the project or in these directories:

Viewed 473

just update my project from rn 0.60.5 -> 0.68.1

"react-navigation": "3.3.2"

i start the project with BUILD SUCCESSFUL but when metro finish reloading app it show error like:

Unable to resolve module react-native/Libraries/Animated/src/AnimatedEvent from /Users/myName/Desktop/ProjectName/aksesapp/node_modules/@react-navigation/native/node_modules/react-native-gesture-handler/DrawerLayout.js: react-native/Libraries/Animated/src/AnimatedEvent could not be found within the project or in these directories: node_modules/@react-navigation/native/node_modules/react-native-gesture-handler/node_modules node_modules/@react-navigation/native/node_modules node_modules ../../../node_modules

import { AnimatedEvent } from 'react-native/Libraries/Animated/src/AnimatedEvent';

enter image description here

1 Answers

You need to import the Animated api from react-native.

import { Animated } from react-native

And then you can use event function like this.

Animated.event()
Related