From 3588f5691b3db3a5673e3e5bbe0cf257c5667eed Mon Sep 17 00:00:00 2001 From: Marcin Dziewulski Date: Tue, 9 Apr 2024 17:24:57 +0200 Subject: [PATCH] fix: allow passing 0 to `multiply`/`divide` functions --- src/hooks/useSpacingHelpers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/useSpacingHelpers.ts b/src/hooks/useSpacingHelpers.ts index 6f4382b..2ef0a27 100644 --- a/src/hooks/useSpacingHelpers.ts +++ b/src/hooks/useSpacingHelpers.ts @@ -17,7 +17,7 @@ export const useSpacingHelpers = () => { const multiply = React.useCallback( value => { - if (value) { + if (typeof value !== 'undefined') { return value * spacing; } @@ -28,7 +28,7 @@ export const useSpacingHelpers = () => { const divide = React.useCallback( value => { - if (value) { + if (typeof value !== 'undefined') { return value / spacing; }