Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useFocusEffect render twice #671

Open
mrrs878 opened this issue Jun 19, 2023 · 1 comment
Open

useFocusEffect render twice #671

mrrs878 opened this issue Jun 19, 2023 · 1 comment

Comments

@mrrs878
Copy link

mrrs878 commented Jun 19, 2023

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>
    );
};
@Mickeygogo
Copy link

航总牛逼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants