Upgrading to 3.2.0
What to check and change when you upgrade an app to ViroReact 3.2.0.
ViroReact 3.2.0 moves to React Native 0.88 and Expo SDK 58 on every platform, including Apple Vision Pro through @reactvision/react-native-visionos 0.88. The renderer binaries are rebuilt on virocore 3.2.0, and the web build uses @reactvision/viro-web-renderer 1.1.1. This is a breaking release: it does not install next to react-native 0.86. React Native 0.86 and Expo SDK 57 stay on ViroReact 3.1.x.
Do this when you upgrade
-
Upgrade React Native and Expo first. 3.2.0 needs
react-native>=0.88.0 <0.89.0andexpo>=58.0.0 <59.0.0, with React 19.3. Follow Expo's SDK 58 upgrade, then install ViroReact:npm install @reactvision/[email protected] -
Run
npx expo prebuildagain after the upgrade, so the native projects are generated for Expo SDK 58 and, in an Android build without theARxRMode, ARCore is taken out (see below). -
visionOS: regenerate the
visionos/folder. A folder generated for React Native 0.86 does not build against 0.88. Install@reactvision/react-native-visionos0.88 and generate the folder again from@reactvision/visionos-template0.88.1. See Regenerating the visionOS folder below. -
Check any
ViroControllerthat setsonPinchoronRotate. It now receives them. See below. -
Web: update
@reactvision/viro-web-rendererto 1.1.1 if you have not already.
Behaviour that changes
ViroController receives drag, pinch and rotate on iOS and Android
ViroController receives drag, pinch and rotate on iOS and AndroidonDrag, onPinch and onRotate on ViroController are now delivered on iOS and Android, with the same payloads as a node's handlers. Before 3.2.0, iOS never enabled pinch and rotate, and Android ignored all three. A controller that already set onPinch or onRotate starts receiving them after the upgrade. The node in the payload is null when the gesture started on nothing that takes it.
Pinch and rotate come from a touch screen, so a Quest controller does not send them. onTouch, onScroll, onSwipe and onControllerStatus stay Android and Quest only, because no iOS input produces them.
Android builds without the AR xRMode leave ARCore out
AR xRMode leave ARCore outWith xRMode set to QUEST, GVR or OVR_MOBILE only, the Expo plugin no longer adds :arcore_client to app/build.gradle and settings.gradle, the com.google.ar.core meta-data, or the com.google.ar.core <queries> entry. A later prebuild without AR removes them. A build that lists AR alongside other modes keeps ARCore. :gvr_common stays in every build, because the renderer links libgvr and audio on Quest runs on GVR audio.
In a build without ARCore, isARSupportedOnDevice reports UNSUPPORTED.
Meta Quest scenes get arSceneNavigator and live viroAppProps
arSceneNavigator and live viroAppPropsA ViroXRSceneNavigator scene on Quest now receives the navigator as arSceneNavigator as well as sceneNavigator, and the navigator's viroAppProps reach it on every change. Before, it got only sceneNavigator with empty viroAppProps, so a scene written for both phones and Quest that reads props.arSceneNavigator.viroAppProps threw.
Editor scene alerts show their own button label
In StudioSceneNavigator, an alert set by a scene's ALERT function shows its own close button label, read from alert_action_button_title. It always read OK before, and still does when the label is empty or not sent. On Meta Quest the alert panel's button widens to fit the label and wraps a long one.
Web
- Physics runs on web. A scene switches the physics world on when it mounts, so a
physicsBodysimulates. Before, bodies on web only moved inside Editor scenes. Gravity is -9.81 unless the scene setsphysicsWorld.gravity. - Clicks reach the node native would give them to. A press on a child with no
onClickgoes to its nearest ancestor that has one. - Changing a node's opacity or visibility no longer resets its position.
- Scene navigation works in
ViroARSceneNavigator.push,replace,jump,popandpopNused to warn and do nothing on web.
See Web Setup Guide for what is new on web, including virtualCamera.
Types that changed
ViroNativeRefisHostInstance | null. React Native 0.88 removed theNativeMethodstype the ref carried. A host component's ref is aHostInstancewith the same methods, so code that calls them needs no change. Code that namesNativeMethodsin its own types does.ViroCommonPropsleaves outViewProps.onClick. React Native 0.88 typesonClickon a View as a pointer event handler, which does not match Viro'sonClick(position, source).
Platform notes
iOS
ViroSound.preloadSoundsloads its sounds and its promise resolves, and a sound played by name (source={{ name }}) plays. See ViroSound.ViroSpatialSoundandViroSoundFieldno longer crash on mount.ViroObjectDetectorboxes and hit-test positions line up in a resized window and in iPad multitasking (Split View, Slide Over, Stage Manager).
Android
Building the Android bridge from source needs Gradle 9.4.1 and AGP 9.2.1, the versions React Native 0.88 brings. An app that consumes the published package is not affected.
visionOS
Regenerating the visionOS folder
@reactvision/react-native-visionos is an optional peer dependency again, with the range >=0.88.0 <0.89.0. Install it, then regenerate visionos/ from the 0.88.1 template:
npm install @reactvision/[email protected]
npx @react-native-community/cli@latest init MyApp \
--template @reactvision/[email protected] \
--directory visionos --skip-install
The patches the Expo plugin copies are regenerated for Expo SDK 58: expo-linking 58.0.17, expo-modules-core 58.1.0, react-native-reanimated 4.7.1, react-native-screens 4.30.1 and react-native-worklets 0.13.0. A sixth, for react-native-gesture-handler 3.3.0, lets it build for visionOS. Three of the SDK 57 patches failed to apply on install. See visionOS Setup Guide.
See also
Updated about 15 hours ago