diff --git a/packages/grafana-ui/src/components/Layout/Stack/Stack.tsx b/packages/grafana-ui/src/components/Layout/Stack/Stack.tsx index 848ff8bd01a..2e24f2332f9 100644 --- a/packages/grafana-ui/src/components/Layout/Stack/Stack.tsx +++ b/packages/grafana-ui/src/components/Layout/Stack/Stack.tsx @@ -13,9 +13,11 @@ export const Stack = React.forwardRef { return ( - {React.Children.map(children, (child) => ( -
{child}
- ))} + {React.Children.toArray(children) + .filter(Boolean) + .map((child, index) => ( +
{child}
+ ))}
); }