Merge pull request #9339 from backstage/dependabot/npm_and_yarn/types/react-17.0.39

chore(deps-dev): bump @types/react from 16.14.18 to 17.0.39
This commit is contained in:
Ben Lambert
2022-02-09 18:29:02 +01:00
committed by GitHub
3 changed files with 13 additions and 5 deletions
@@ -89,12 +89,15 @@ export function TabbedCard(props: PropsWithChildren<Props>) {
let selectedTabContent: ReactNode;
if (!value) {
React.Children.map(children, (child, index) => {
if (index === selectedIndex) selectedTabContent = child?.props.children;
if (React.isValidElement(child) && index === selectedIndex) {
selectedTabContent = child?.props.children;
}
});
} else {
React.Children.map(children, child => {
if (child?.props.value === value)
if (React.isValidElement(child) && child?.props.value === value) {
selectedTabContent = child?.props.children;
}
});
}