pmndrs / use-cannon

👋💣 physics based hooks for @react-three/fiber
https://cannon.pmnd.rs
2.74k stars 154 forks source link

useSphere args must be an array #291

Closed bjornstar closed 2 years ago

bjornstar commented 2 years ago

⚠️ This is a breaking change and should have a major version bump. ⚠️

There have been many, many instances of people trying to put an array as the args in useSphere and reporting issues when it didn't work. There is an expectation that the args are an array so this change makes the code match that expectation.

This changes users will need to make are minor and straightforward: wrap the number in brackets.

Initially the failure mode was throwing an error: TypeError: undefined is not a function which isn't very helpful. So I went ahead and did a small type check to help people migrate to the new version easier. Now it says: Error: useSphere args must be an array

Fixes #235 Fixes #287

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pmndrs/use-cannon/8gcGiobEzNE5ePHiGvKoyRBbeNkz
✅ Preview: https://use-cannon-git-fork-bjornstar-update-use-sphere-args-pmndrs.vercel.app