Skip to content

Commit 621ec8e

Browse files
committed
Accept ToggleButton elements in Flex
1 parent 8302a46 commit 621ec8e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/lib/components/layout/Flex.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import yoga from 'yoga-layout-prebuilt';
1717
import type { Flex as FlexElement } from '../../renderer/inSim';
1818
import type { ButtonProps } from '../Button';
1919
import { Button } from '../Button';
20+
import { ToggleButton } from '../ui';
2021

2122
export type FlexProps = PositionProps &
2223
Partial<
@@ -272,7 +273,8 @@ export const Flex = forwardRef(function FlexWithRef(
272273
});
273274

274275
const isValidChild = (child: ReactElement | null): child is ReactElement =>
275-
child !== null && (child.type === Button || child.type === Flex);
276+
child !== null &&
277+
(child.type === Button || child.type === ToggleButton || child.type === Flex);
276278

277279
const directionMap: Record<
278280
NonNullable<FlexProps['direction']>,

0 commit comments

Comments
 (0)