react-three-fiber

Enabling VR

Supplying the vr flag enables Three's VR mode and switches the render-loop to gl.setAnimationLoop as described in Three's docs.

import * as VR from "!exports-loader?WEBVR!three/examples/js/vr/WebVR";
import { Canvas } from "react-three-fiber";
<Canvas
vr
onCreated={({ gl }) => document.body.appendChild(VR.createButton(gl))}
/>;
Edit this page on GitHub