Patch for Viro3DSceneNavigator & ViroScene
Closed this issue ยท 2 comments
g-pex-aerian commented
Hi! ๐
Firstly, thanks for your work on this project! ๐
Today I used patch-package to patch @viro-community/react-viro@2.23.0
for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/@viro-community/react-viro/components/Viro3DSceneNavigator.tsx b/node_modules/@viro-community/react-viro/components/Viro3DSceneNavigator.tsx
index 68d8eed..4d7899e 100644
--- a/node_modules/@viro-community/react-viro/components/Viro3DSceneNavigator.tsx
+++ b/node_modules/@viro-community/react-viro/components/Viro3DSceneNavigator.tsx
@@ -484,7 +484,11 @@ export class Viro3DSceneNavigator extends React.Component<Props, State> {
// If the user simply passes us the props from the root React component,
// then we'll have an extra 'rootTag' key which React automatically includes
// so remove it.
- delete this.sceneNavigator.viroAppProps.rootTag;
+ try {
+ delete this.sceneNavigator.viroAppProps.rootTag;
+ } catch (error) {
+ console.log(error)
+ }
const {
viroAppProps = {}, // Make sure viroAppProps aren't null to save us having to always check
diff --git a/node_modules/@viro-community/react-viro/components/ViroScene.tsx b/node_modules/@viro-community/react-viro/components/ViroScene.tsx
index d860cfd..547d48f 100644
--- a/node_modules/@viro-community/react-viro/components/ViroScene.tsx
+++ b/node_modules/@viro-community/react-viro/components/ViroScene.tsx
@@ -55,7 +55,7 @@ export class ViroScene extends ViroBase<Props> {
*/
event.nativeEvent.platformInfoViro.vrPlatform =
event.nativeEvent.platformInfoViro.platform;
- this.props.onPlatformUpdate &&
+ this.props?.onPlatformUpdate &&
this.props.onPlatformUpdate(event.nativeEvent.platformInfoViro);
}
This issue body was partially generated by patch-package.
g-pex-aerian commented
Fixes: #134
robertjcolley commented
Fixed this in another patch. Closing! ๐