Pmdnrs.docs
Quick search [⌘ + K]

Installation

Learn how to install react-three-fiber

yarn add three react-three-fiber
# or
npm install three react-three-fiber

Fiber is compatible with React v16.8+ and works with ReactDOM and React Native.

Getting started with React Three Fiber is simple, but various frameworks may require particular attention. We've put together guides for getting started with each popular framework:

  • Create React App
  • Next.js
  • Gatsby

If you just want to give it a try, fork this simple example on codesandbox!

Create React App

create-react-app will work out of the box, nothing special here!

Add mention of official create-react-app template

Next.js

You can use Fiber on next by installing the next-transpile-modules module:

yarn add next-transpile-modules -D
# or
npm install next-transpile-modules --save-dev

Then, add this to your next.config.js

const withTM = require('next-transpile-modules')(['three'])

module.exports = withTM()

Check out the official next.js example for react-three-fiber.