Skip to content
Evan Bacon edited this pageSep 25, 2019 · 2 revisions

Installation

NPM

In[email protected]Three.js is apeer dependency

yarn add three expo-three

Usage

Import the library into your JavaScript file:

importExpoTHREEfrom'expo-three';

Get a global instance ofthree.jsfromexpo-three:

import{THREE}from'expo-three';

Due to some issues with theMetro bundleryou 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 ofTHREEwith side-effects.

global.THREE=global.THREE||THREE;
Clone this wiki locally