Skip to content

Commit

Permalink
fix: πŸ› ?? operator instead of || for grid spacing prop check
Browse files Browse the repository at this point in the history
Use nullish coalescing operator (??) instead of or (||) operator to
check for existence of `spacing` value which can be 0 which is falsy
causing unexpected values.

βœ… Closes: 114
  • Loading branch information
20BBrown14 committed Mar 8, 2021
1 parent 4c01409 commit 1c061d7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/SQForm/SQForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function SQForm({
<Grid
{...muiGridProps}
container
spacing={muiGridProps.spacing || 2}
spacing={muiGridProps.spacing ?? 2}
>
{children}
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion src/components/SQFormDialog/SQFormDialogInner.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function SQFormDialogInner({
<Grid
{...muiGridProps}
container
spacing={muiGridProps.spacing || 2}
spacing={muiGridProps.spacing ?? 2}
>
{children}
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion src/components/SQFormDialogStepper/SQFormDialogStepper.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export function SQFormDialogStepper({
<Grid
{...muiGridProps}
container
spacing={muiGridProps.spacing || 3}
spacing={muiGridProps.spacing ?? 3}
justify="center"
>
{currentChild}
Expand Down

0 comments on commit 1c061d7

Please sign in to comment.