Embedding ReactXR in a Route/Tab #279
-
Hi I've been using react with WebXR and 1st off thanks for the library so helpful and within an ecosystem I love. Im currently building an application with multiple navigation tabs and want to have one that has the WebXR canvas however the app crashes when switching to certain tabs, any thoughts on how to approach this? Should I embed the canvas on its own layer and enable it upon tab touch or do I need to call something to end the session gracefully? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, you can only have one session active in a browser at a time on some platforms. I'd see https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API/Startup_and_shutdown#ending_the_webxr_session. const { session } = useXR()
await session.end() |
Beta Was this translation helpful? Give feedback.
Yes, you can only have one session active in a browser at a time on some platforms. I'd see https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API/Startup_and_shutdown#ending_the_webxr_session.