I want to run my animations from react-native-reanimated everytime my screen is focused. How can I achieve this.
Asked
Active
Viewed 566 times
1 Answers
1
I am not sure whether I understand your question correctly, but in most cases you can use the useIsFocused hook from react navigation.
like this:
import React from "react";
import { useIsFocused } from '@react-navigation/native';
function YourScreenScreen() {
const isFocused = useIsFocused();
React.useEffect(() => {
//put whatever you want here when the screen is focused
}, [isFocused]);
return <>......</>;
}
more reference here Hope this answers your question, Gl!

Faras Al Kharusi
- 23
- 5