We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 15a1985 commit daec4f4Copy full SHA for daec4f4
1 file changed
src/libs/Navigation/OnyxTabNavigator.tsx
@@ -73,11 +73,14 @@ const getTabNames = (children: React.ReactNode): string[] => {
73
const result: string[] = [];
74
75
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
- }
+ if (!React.isValidElement(child)) {
+ return;
+ }
+
+ const element = child as React.ReactElement<{name?: string}>;
81
82
+ if (typeof element.props.name === 'string') {
83
+ result.push(element.props.name);
84
}
85
});
86
0 commit comments