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

Installation

NPM

In expo-three@5.0.0 Three.js is a peer dependency

yarn add three expo-three

Usage

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;
Clone this wiki locally