Skip to content

Commit f187864

Browse files
committed
Fix useBox default args, bump version to 0.4.9
1 parent b1257fe commit f187864

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "use-cannon",
3-
"version": "0.4.8",
3+
"version": "0.4.9",
44
"description": "physics based hooks for react-three-fiber",
55
"keywords": [
66
"cannon",

src/hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ export function usePlane(fn: PlaneFn, fwdRef?: React.MutableRefObject<THREE.Obje
299299
return useBody('Plane', fn, () => [], fwdRef)
300300
}
301301
export function useBox(fn: BoxFn, fwdRef?: React.MutableRefObject<THREE.Object3D>) {
302-
return useBody('Box', fn, (args) => args.map((x: number) => x / 2) || [0.5, 0.5, 0.5], fwdRef)
302+
return useBody('Box', fn, (args) => (args ? args.map((x: number) => x / 2) : [0.5, 0.5, 0.5]), fwdRef)
303303
}
304304
export function useCylinder(fn: CylinderFn, fwdRef?: React.MutableRefObject<THREE.Object3D>) {
305305
return useBody('Cylinder', fn, (args) => args, fwdRef)

0 commit comments

Comments
 (0)