Unverified Commit 66d2eae2 authored by LUIS ANAYA's avatar LUIS ANAYA Committed by GitHub

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

- Removed deprecated drei dependency. 
- Added @react-three/drei and updated imports. 
- Upgraded other dependencies to latest versions.
parent 7380f20c
const withTM = require('next-transpile-modules')(['drei', 'three']) const withTM = require('next-transpile-modules')(['@react-three/drei', 'three'])
module.exports = withTM() module.exports = withTM()
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
"start": "next start" "start": "next start"
}, },
"dependencies": { "dependencies": {
"drei": "2.2.21", "@react-three/drei": "3.8.6",
"next": "10.0.5", "next": "10.0.7",
"react": "17.0.1", "react": "17.0.1",
"react-dom": "17.0.1", "react-dom": "17.0.1",
"react-three-fiber": "5.3.11", "react-three-fiber": "5.3.19",
"three": "0.125.0" "three": "0.126.0"
}, },
"devDependencies": { "devDependencies": {
"next-transpile-modules": "6.0.0" "next-transpile-modules": "6.3.0"
}, },
"license": "MIT" "license": "MIT"
} }
import dynamic from 'next/dynamic' import dynamic from 'next/dynamic'
import { Suspense } from 'react' import { Suspense } from 'react'
import { Canvas } from 'react-three-fiber' import { Canvas } from 'react-three-fiber'
import { OrbitControls } from 'drei' import { OrbitControls } from '@react-three/drei'
const Bird = dynamic(() => import('../components/Bird'), { ssr: false }) const Bird = dynamic(() => import('../components/Bird'), { ssr: false })
......
import { useRef, useState } from 'react' import { useRef, useState } from 'react'
import { Canvas, useFrame } from 'react-three-fiber' import { Canvas, useFrame } from 'react-three-fiber'
import { OrbitControls, Box } from 'drei' import { OrbitControls, Box } from '@react-three/drei'
const MyBox = (props) => { const MyBox = (props) => {
const mesh = useRef() const mesh = useRef()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment