Replies: 1 comment
-
To fix the issue you need to add import { Mesh } from "three";
import { usePlane } from "@react-three/cannon";
const Ground = () => {
const [ref, api] = usePlane<Mesh>(() => ({
rotation: [0, 0, 0],
position: [0, 0, 0],
}));
return (
<mesh ref={ref}>
<planeBufferGeometry attach={"geometry"} args={[100, 100]} />
<meshStandardMaterial attach={"material"} color={"hotpink"} />
</mesh>
);
};
export default Ground; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have the bellow code in my react app using react-three/cannon in NextJS with TypeScript
When I try to pass the ref I get from
usePlane
intomesh
I get a TypeError saying -Everything else here is working the way it should, it's just this error that's an issue. What can be done to solve this issue?
Beta Was this translation helpful? Give feedback.
All reactions