admin管理员组文章数量:1402138
Im running into alot of issues trying to run react three fiber on react native app(expo sdk 52). I have a simple box setup but get error saying 'cannot convert undefined value to object'. I tried playing around with different r3f versions and have yet to figure it out. New to r3f so any help would be appreciated.
"expo": "~52.0.37",
"@react-three/drei": "^8.8.0",
"@react-three/fiber": "^8.18.0",
"three": "^0.174.0",
"react": "^18.3.1",
"react-dom": "18.3.1",
"expo-gl": "~11.0.2",
import React from "react";
import { Canvas } from "@react-three/fiber/native";
import { View } from "react-native";
import * as THREE from "three";
const Box = () => {
return (
<View style={{ flex: 1 }}>
<Canvas>
<ambientLight intensity={0.5} />
<pointLight position={[10, 10, 10]} />
<mesh>
<boxGeometry args={[1, 1, 1]} />
<meshStandardMaterial color="blue" />
</mesh>
</Canvas>
</View>
);
};
export default Box;
TypeError: Cannot convert undefined value to object
Tried updating and downgrading different versions of r3f, expo-gl but get same error. I tried importing GLTF using useGLTF and still was not succesful in rendering an object.
本文标签: threejsReact three fiber error rendering 3dmodels on expo react native 1831Stack Overflow
版权声明:本文标题:three.js - React three fiber error rendering 3dmodels on expo react native 18.3.1 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744327038a2600777.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论