pmndrs / use-cannon

👋💣 physics based hooks for @react-three/fiber

Home Page:https://cannon.pmnd.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add deps to hooks: useBox, usePlane e.t.c.

MaxmaxmaximusAWS opened this issue · comments

now i have this:

const [ref, api] = useBox(() => ({
    mass: 1,
    args: [4, 4, 4],
    isKinematic: true,
}))

but want to this:

const [size, setSize] = useState([4, 4, 4])

const [ref, api] = useBox(() => ({
    mass: 1,
    args: size,
    isKinematic: true,
}), [size])