Skip to content

Commit 05bec02

Browse files
committed
fix(react): Remove ionTabs props from passing to children, fixes #22040
1 parent aeda33d commit 05bec02

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/react/src/components/navigation/IonTabs.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export class IonTabs extends React.Component<Props> {
8585
render() {
8686
let outlet: React.ReactElement<{}> | undefined;
8787
let tabBar: React.ReactElement | undefined;
88+
const { className, onIonTabsDidChange, onIonTabsWillChange, ...props } = this.props;
8889

8990
const children = typeof this.props.children === 'function' ?
9091
(this.props.children as ChildFunction)(this.ionTabContextState) : this.props.children;
@@ -99,14 +100,12 @@ export class IonTabs extends React.Component<Props> {
99100
outlet = child.props.children[0];
100101
}
101102
if (child.type === IonTabBar) {
102-
const { onIonTabsDidChange, onIonTabsWillChange } = this.props;
103103
tabBar = React.cloneElement(child, {
104104
onIonTabsDidChange,
105105
onIonTabsWillChange,
106106
ref: this.tabBarRef
107107
});
108108
} else if (child.type === Fragment && child.props.children[1].type === IonTabBar) {
109-
const { onIonTabsDidChange, onIonTabsWillChange } = this.props;
110109
tabBar = React.cloneElement(child.props.children[1], {
111110
onIonTabsDidChange,
112111
onIonTabsWillChange,
@@ -122,7 +121,7 @@ export class IonTabs extends React.Component<Props> {
122121
throw new Error('IonTabs needs a IonTabBar');
123122
}
124123

125-
const { className, ...props } = this.props;
124+
126125

127126
return (
128127
<IonTabsContext.Provider

0 commit comments

Comments
 (0)