Update the react-three-js example. (#22549)

- Removed deprecated drei dependency. 
- Added @react-three/drei and updated imports. 
- Upgraded other dependencies to latest versions.
This commit is contained in:
LUIS ANAYA 2021-02-26 00:22:35 +01:00 committed by GitHub
parent 7380f20cdb
commit 66d2eae2c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View file

@ -1,3 +1,3 @@
const withTM = require('next-transpile-modules')(['drei', 'three'])
const withTM = require('next-transpile-modules')(['@react-three/drei', 'three'])
module.exports = withTM()

View file

@ -8,15 +8,15 @@
"start": "next start"
},
"dependencies": {
"drei": "2.2.21",
"next": "10.0.5",
"@react-three/drei": "3.8.6",
"next": "10.0.7",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-three-fiber": "5.3.11",
"three": "0.125.0"
"react-three-fiber": "5.3.19",
"three": "0.126.0"
},
"devDependencies": {
"next-transpile-modules": "6.0.0"
"next-transpile-modules": "6.3.0"
},
"license": "MIT"
}

View file

@ -1,7 +1,7 @@
import dynamic from 'next/dynamic'
import { Suspense } from 'react'
import { Canvas } from 'react-three-fiber'
import { OrbitControls } from 'drei'
import { OrbitControls } from '@react-three/drei'
const Bird = dynamic(() => import('../components/Bird'), { ssr: false })

View file

@ -1,6 +1,6 @@
import { useRef, useState } from 'react'
import { Canvas, useFrame } from 'react-three-fiber'
import { OrbitControls, Box } from 'drei'
import { OrbitControls, Box } from '@react-three/drei'
const MyBox = (props) => {
const mesh = useRef()