Skip to content

Commit

Permalink
Merge pull request #48 from grapp-dev/fix/use-spacing-helpers
Browse files Browse the repository at this point in the history
fix: allow passing 0 to `multiply`/`divide` functions
  • Loading branch information
mobily authored Apr 9, 2024
2 parents a656123 + 3588f56 commit e68851a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useSpacingHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const useSpacingHelpers = () => {

const multiply = React.useCallback(
value => {
if (value) {
if (typeof value !== 'undefined') {
return value * spacing;
}

Expand All @@ -28,7 +28,7 @@ export const useSpacingHelpers = () => {

const divide = React.useCallback(
value => {
if (value) {
if (typeof value !== 'undefined') {
return value / spacing;
}

Expand Down

0 comments on commit e68851a

Please sign in to comment.