fix(striker-ui): skip empty keys when building Grid items

main
Tsu-ba-me 2 years ago
parent 06b33273f3
commit f15592f82f
  1. 4
      striker-ui/components/Grid.tsx
  2. 2
      striker-ui/types/Grid.d.ts

@ -13,14 +13,14 @@ const Grid: FC<GridProps> = ({
return items.map(([itemId, itemGridProps], index) => {
const key = itemId;
return (
return itemGridProps ? (
<MUIGrid
{...calculateItemBreakpoints(index, key)}
key={key}
item
{...itemGridProps}
/>
);
) : undefined;
});
}, [calculateItemBreakpoints, layout]);

@ -1,5 +1,5 @@
type GridLayout = {
[id: string]: import('@mui/material').GridProps;
[id: string]: import('@mui/material').GridProps | undefined;
};
type GridOptionalProps = {

Loading…
Cancel
Save