router
router copied to clipboard
useFocusEffect render twice
Which package manager are you using? (Yarn is recommended)
yarn
Summary
useFocusEffect render twice when entry page
This doesn't happen if i use useFocusEffect impoted from '@react-navigation/native'
Minimal reproducible example
import { useFocusEffect } from 'expo-router';
export default () => {
// log 2 times
console.log('render');
useFocusEffect(useCallback(() => {
//
}, []));
return (
<Text>hello</Text>
);
};