admin管理员组文章数量:1124682
I'm creating a viewport, but I keep getting:
TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner')
Currently using react 18
'use client'
import { useState, useEffect, useCallback } from 'react'
import { Canvas, Euler, Vector3 } from '@react-three/fiber'
import { OrbitControls, Grid, Environment, PerspectiveCamera, OrthographicCamera } from '@react-three/drei'
It doesn't work, so I tried
const DynamicCanvas = dynamic(() => import('@react-three/fiber').then(mod => mod.Canvas), { ssr: false });
const OrbitControls = dynamic(() => import('@react-three/drei').then(mod => mod.OrbitControls), { ssr: false });
const Grid = dynamic(() => import('@react-three/drei').then(mod => mod.Grid), { ssr: false });
const Environment = dynamic(() => import('@react-three/drei').then(mod => mod.Environment), { ssr: false });
const PerspectiveCamera = dynamic(() => import('@react-three/drei').then(mod => mod.PerspectiveCamera), { ssr: false });
const OrthographicCamera = dynamic(() => import('@react-three/drei').then(mod => mod.OrthographicCamera), { ssr: false });
It's still giving me the same error. I even updated to the latest version of react and nextjs, and it still doesn't work.
本文标签:
版权声明:本文标题:javascript - TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner') NextJs with ThreeJs - 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736644232a1946067.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论