React Native WebGPU

Expo

Start with raw WebGPU, Three.js, or React Three Fiber on Expo

The React Native WebGPU Expo template includes raw WebGPU, Three.js, and React Three Fiber examples for iOS, Android, and web.

Create a project

npx create-expo-app@latest my-webgpu-app --template https://github.com/wcandillon/react-native-webgpu/tree/main/apps/expo-webgpu

Open the app and choose an example from the menu:

  • WebGPU triangle uses react-native-webgpu directly and renders WGSL without a 3D framework.
  • Three.js imports three/webgpu and creates the scene imperatively.
  • React Three Fiber uses declarative JSX with the standard Fiber module build.

The template installs the required Reanimated and Worklets peers, enables the react-native-webgpu config plugin, and includes the Metro resolver used by the React Three Fiber example.

For a walkthrough of the React Three Fiber example, watch the video below.

Config plugin

react-native-webgpu ships its own Expo config plugin. Add it to the plugins array of your app config:

app.json
{
  "expo": {
    "plugins": ["react-native-webgpu"]
  }
}

The plugin disables Metal API Validation in the shared Xcode scheme of your iOS project - the equivalent of unchecking Product → Scheme → Edit Scheme → Run → Diagnostics → Metal API Validation in Xcode. This is required to run WebGPU on the iOS Simulator: Metal API validation flags false positives in Dawn that do not occur on a physical device and would otherwise crash the app (see the troubleshooting section).

With Continuous Native Generation, the ios directory is regenerated by npx expo prebuild --clean, so unchecking the setting manually in Xcode does not stick - the config plugin re-applies it on every prebuild.

The plugin only affects the iOS Xcode scheme; it is a no-op on Android and it changes nothing for release builds on physical devices. Since the plugin ships with the package, its version is always aligned with the react-native-webgpu version you have installed.