-
Notifications
You must be signed in to change notification settings - Fork 92
Home
Evan Bacon edited this page Sep 25, 2019
·
2 revisions
In
[email protected]
Three.js is a peer dependency
yarn add three expo-three
Import the library into your JavaScript file:
import ExpoTHREE from 'expo-three';
Get a global instance of three.js
from expo-three
:
import { THREE } from 'expo-three';
Due to some issues with the Metro bundler you may need to manually define the global instance of Three.js. This is important because three.js doesn't fully use ECMAScript but rather mutates a single global instance of THREE
with side-effects.
global.THREE = global.THREE || THREE;