Skip to content

Commit

Permalink
Fix booleans in Stack / Grid (#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek authored Jun 26, 2024
1 parent 13454e8 commit 368832a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/lake/src/components/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export const Grid = ({
]}
>
{Children.map(children, child => {
if (isNullish(child)) {
// null, undefined, true and false are valid children. They simply don’t render
if (isNullish(child) || typeof child === "boolean") {
return child;
}

Expand Down
3 changes: 2 additions & 1 deletion packages/lake/src/components/Stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export const Stack = forwardRef<View, Props>(
return (
<Box ref={forwardedRef} {...props}>
{Children.map(children, (child, index) => {
if (isNullish(child)) {
// null, undefined, true and false are valid children. They simply don’t render
if (isNullish(child) || typeof child === "boolean") {
return child;
}

Expand Down

0 comments on commit 368832a

Please sign in to comment.