HomeGuidesAPI ReferenceChangelogDiscussions
Hire a ReactVision Expert 🛠️Launch Studio 🖥️Sponsor on GitHub ❤️Log In
Guides

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

  1. Upgrade React Native and Expo first. 3.2.0 needs react-native >=0.88.0 <0.89.0 and expo >=58.0.0 <59.0.0, with React 19.3. Follow Expo's SDK 58 upgrade, then install ViroReact:

    npm install @reactvision/[email protected]
    
  2. Run npx expo prebuild again after the upgrade, so the native projects are generated for Expo SDK 58 and, in an Android build without the AR xRMode, ARCore is taken out (see below).

  3. visionOS: regenerate the visionos/ folder. A folder generated for React Native 0.86 does not build against 0.88. Install @reactvision/react-native-visionos 0.88 and generate the folder again from @reactvision/visionos-template 0.88.1. See Regenerating the visionOS folder below.

  4. Check any ViroController that sets onPinch or onRotate. It now receives them. See below.

  5. Web: update @reactvision/viro-web-renderer to 1.1.1 if you have not already.


Behaviour that changes

ViroController receives drag, pinch and rotate on iOS and Android

onDrag, 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

With 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

A 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 physicsBody simulates. Before, bodies on web only moved inside Editor scenes. Gravity is -9.81 unless the scene sets physicsWorld.gravity.
  • Clicks reach the node native would give them to. A press on a child with no onClick goes 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, pop and popN used to warn and do nothing on web.

See Web Setup Guide for what is new on web, including virtualCamera.

Types that changed

  • ViroNativeRef is HostInstance | null. React Native 0.88 removed the NativeMethods type the ref carried. A host component's ref is a HostInstance with the same methods, so code that calls them needs no change. Code that names NativeMethods in its own types does.
  • ViroCommonProps leaves out ViewProps.onClick. React Native 0.88 types onClick on a View as a pointer event handler, which does not match Viro's onClick(position, source).

Platform notes

iOS

  • ViroSound.preloadSounds loads its sounds and its promise resolves, and a sound played by name (source={{ name }}) plays. See ViroSound.
  • ViroSpatialSound and ViroSoundField no longer crash on mount.
  • ViroObjectDetector boxes 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