added
ViroReact 3.2.0: React Native 0.88, ViroController gestures and web physics
about 15 hours ago by ReadMe API
ViroReact moves to React Native 0.88 and Expo SDK 58 on every platform, Apple Vision Pro included, through @reactvision/react-native-visionos 0.88.1. ViroController takes the same drag, pinch and rotate handlers on iOS and Android, iOS sounds load by name and preload, and AR scenes on the web gain physics, collisions, scene navigation and a virtual camera for previewing without one. Renderer binaries are rebuilt on virocore 3.2.0, and the web build uses @reactvision/viro-web-renderer 1.1.1. This release is breaking. Read Check when upgrading and Upgrading to 3.2.0 before you update.
Everywhere
- Breaking: React Native 0.88 and Expo SDK 58.
react-nativeis>=0.88.0 <0.89.0andexpois>=58.0.0 <59.0.0, with React 19.3. React Native 0.86 and Expo SDK 57 stay on 3.1.x. ViroControllerdeliversonDrag,onPinchandonRotateon iOS and Android, with the same payloads as a node's handlers. Pinch and rotate come from a touch screen, so a Quest controller does not send them. See ViroController.ViroNativeRefisHostInstance | null, since React Native 0.88 removedNativeMethods. The methods are the same.- An Editor scene's alert shows its own close button label (
StudioSceneNavigator) instead of always OK, and on Meta Quest the alert's button widens to fit it.
iOS
ViroSound.preloadSoundsand sounds played by name work. The promise resolves with{ result, msg }as on Android, and a downloaded sound opens. See ViroSound.ViroSpatialSoundandViroSoundFieldno longer crash on mount.ViroObjectDetectorboxes and hit tests line up in a resized window and in iPad multitasking.
Android
- A build without the
ARxRMode leaves ARCore out (Expo plugin). A Quest-only app no longer carries:arcore_client, its meta-data or its<queries>entry. See HorizonOS Setup Guide. - Building the bridge from source needs Gradle 9.4.1 and AGP 9.2.1. Apps that consume the published package are not affected.
Meta Quest
- A
ViroXRSceneNavigatorscene getsarSceneNavigatorand liveviroAppProps, as on a phone. A scene written for both threw on Quest.
visionOS
- Runs on React Native 0.88 through
@reactvision/react-native-visionos0.88.1, an optional peer dependency again (>=0.88.0 <0.89.0). Generate thevisionos/folder from@reactvision/visionos-template0.88.1. - The patches the Expo plugin copies apply to Expo SDK 58. Three of the SDK 57 ones failed on install, and a new one lets
react-native-gesture-handler3.3.0 build for visionOS. See visionOS Setup Guide.
Web
- Physics: a
physicsBodysimulates,onCollisionfires with the other body'sviroTag, and a node's ref takesapplyImpulse,applyTorqueImpulseandsetVelocity. See Physics. virtualCameraonViroARSceneNavigatorpreviews an AR scene with no camera or permission prompt, with a floor plane and dragging. See Web Setup Guide.- Scene navigation (
push,replace,jump,pop,popN) works inViroARSceneNavigator. - Clicks reach the node native would give them to, and changing opacity or visibility no longer resets a node's position.
Check when upgrading
- Upgrade React Native and Expo first. 3.2.0 does not install next to
react-native0.86. - On visionOS, regenerate the
visionos/folder from@reactvision/visionos-template0.88.1 and install@reactvision/[email protected]. A 0.86 folder does not build against 0.88. - A
ViroControllerthat setonPinchoronRotatenow receives them. The node in the payload is null when the gesture started on nothing that takes it.