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

Cannot read property 'locktoportrait' of null #302

Open
Usman-02501 opened this issue Sep 30, 2024 · 0 comments
Open

Cannot read property 'locktoportrait' of null #302

Usman-02501 opened this issue Sep 30, 2024 · 0 comments

Comments

@Usman-02501
Copy link

useFocusEffect(
React.useCallback(() => {
return () => {
Orientation.lockToPortrait();
StatusBar.setHidden(false);
};
}, [navigation]),
);

const handleFullscreenToggle = () => {
if (isFullScreen) {
Orientation.lockToPortrait();
setFullScreen(false);
StatusBar.setHidden(false);
setOrientation('portrait');
} else {
Orientation.lockToPortrait();
setFullScreen(true);
StatusBar.setHidden(true);
setOrientation('portrait');
}
};

const handleOrientationToggle = () => {
if (orientation === 'landscape') {
Orientation.lockToPortrait();
setOrientation('portrait');
} else {
StatusBar.setHidden(true);
Orientation.lockToLandscape();
setOrientation('landscape');
}
};
How to solve this issue in expo for android platform.

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

No branches or pull requests

1 participant