Skip to content

Commit daec4f4

Browse files
committed
fix:65151: eslint fix
1 parent 15a1985 commit daec4f4

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/libs/Navigation/OnyxTabNavigator.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,14 @@ const getTabNames = (children: React.ReactNode): string[] => {
7373
const result: string[] = [];
7474

7575
React.Children.forEach(children, (child) => {
76-
if (React.isValidElement(child)) {
77-
const element = child as React.ReactElement<{name?: string}>;
78-
if (typeof element.props.name === 'string') {
79-
result.push(element.props.name);
80-
}
76+
if (!React.isValidElement(child)) {
77+
return;
78+
}
79+
80+
const element = child as React.ReactElement<{name?: string}>;
81+
82+
if (typeof element.props.name === 'string') {
83+
result.push(element.props.name);
8184
}
8285
});
8386

0 commit comments

Comments
 (0)