Skip to content

Cannot read property 'locktoportrait' of nullΒ #302

@Usman-02501

Description

@Usman-02501

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions