RuntimeException: Illegal callback invocation from native module. This callback type only permits a single invocation from native code.
logs in sentry:
com.facebook.react.bridge.CallbackImpl in invoke at line 26
com.facebook.react.bridge.PromiseImpl in reject at line 231
com.facebook.react.bridge.PromiseImpl in reject at line 70
com.reactnativesystemnavigationbar.SystemNavigationBarModule in fullScreen at line 118
react-native-system-navigation-bar version
2.6.4
React Native version
0.71.13
Snack, code example, screenshot, or link to a repository
// Handle full screem mode
useEffect(() => {
const handleOrientationChange = (orientation: OrientationType) => {
switch (orientation) {
case OrientationType['LANDSCAPE-LEFT']:
toggleFullScreenMode(true);
setTimeout(() => {
Orientation.lockToLandscapeLeft();
SystemNavigationBar.fullScreen(true);
});
break;
case OrientationType['LANDSCAPE-RIGHT']:
toggleFullScreenMode(true);
setTimeout(() => {
Orientation.lockToLandscapeRight();
SystemNavigationBar.fullScreen(true);
});
break;
default:
toggleFullScreenMode(false);
setTimeout(() => {
Orientation.lockToPortrait();
SystemNavigationBar.fullScreen(false);
});
break;
}
Orientation.unlockAllOrientations();
};
// Unlock all orientations at the start
Orientation.unlockAllOrientations();
// Add orientation listener
Orientation.addDeviceOrientationListener(handleOrientationChange);
// Cleanup on component unmount
return () => {
Orientation.removeDeviceOrientationListener(handleOrientationChange);
Orientation.lockToPortrait(); // Ensure the app returns to portrait mode
};
}, []);
Description
The app crashed with the following error.
RuntimeException: Illegal callback invocation from native module. This callback type only permits a single invocation from native code.
logs in sentry:
com.facebook.react.bridge.CallbackImpl in invoke at line 26 com.facebook.react.bridge.PromiseImpl in reject at line 231 com.facebook.react.bridge.PromiseImpl in reject at line 70 com.reactnativesystemnavigationbar.SystemNavigationBarModule in fullScreen at line 118
react-native-system-navigation-bar version
2.6.4
React Native version
0.71.13
Snack, code example, screenshot, or link to a repository