I attempted to use react-native-orientation within a webview in order to make it the only view that would rotate.
import React, {useEffect} from 'react';
import { WebView } from 'react-native-webview';
import Orientation from "react-native-orientation"
export function GameWebViewScreen({navigation}) {
const link = ****
useEffect(() => {
Orientation.unlockAllOrientations();
}, [])
return <WebView source={{uri: link}}/>
}
Upon calling unlockAllOrientations, I encountered a TypeError: null is not an object. Could this be due to my failure to configure the native files as instructed here? Unfortunately, I do not currently have access to these files.
I also tried using a class component with the same outcome.
If anyone has alternative recommendations for libraries that can control rotation on specific views, I am open to suggestions.