core-components: internal refactor to support revert to TS 4.9

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-07-13 13:21:16 +02:00
parent 4b4cd47b88
commit d03258bb52
@@ -95,8 +95,11 @@ export function TabbedCard(props: PropsWithChildren<Props>) {
});
} else {
React.Children.map(children, child => {
if (React.isValidElement(child) && child?.props.value === value) {
selectedTabContent = child?.props?.children;
if (
React.isValidElement<{ children?: unknown; value?: unknown }>(child) &&
child?.props.value === value
) {
selectedTabContent = child?.props.children;
}
});
}