Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tsx error 类型“JSX.IntrinsicElements”上不存在属性“primitive”。 #3478

Open
changmen1 opened this issue Feb 24, 2025 · 0 comments

Comments

@changmen1
Copy link

In the tsx component, an error message is displayed: Property 'primitive' does not exist on type 'JSX.IntrinsicElements'. What should I do?

import { Canvas } from "@react-three/fiber";
import { useGLTF, Stage, PresentationControls } from "@react-three/drei";
function Model(props:any) {
  const { scene } = useGLTF('/bmw.glb');
  return <primitive object={scene} {...props} />;
}

export default () => {
  const { scene } = useGLTF('/3d/laptop.glb');
  return (
    <>
      <Canvas dpr={[1, 2]} shadows camera={{ fov: 45 }} style={{ position: 'absolute' }}>
        <PresentationControls speed={1.5} global zoom={0.5} polar={[-0.1, Math.PI / 4]}>
          <Stage environment={'sunset'}>
            <Model scale={0.01} />
          </Stage>
        </PresentationControls>
      </Canvas>
    </>
  );
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant