Installation
yarn add three react-three-fiber# ornpm install three react-three-fiberFiber 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# ornpm install next-transpile-modules --save-devThen, 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.