-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathTabs.tsx
More file actions
25 lines (22 loc) · 749 Bytes
/
Tabs.tsx
File metadata and controls
25 lines (22 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import React from 'react';
import { IonLabel, IonRouterOutlet, IonTabBar, IonTabButton, IonTabs, IonPage } from '@ionic/react';
import { Route, Redirect } from 'react-router';
interface TabsProps {}
const Tabs: React.FC<TabsProps> = () => {
return (
<IonPage>
<IonTabs>
<IonRouterOutlet>
<Redirect from="/tabs" to="/tabs/tab1" exact />
<Route path="/tabs/tab1" render={() => <IonLabel>Tab 1</IonLabel>} />
</IonRouterOutlet>
<IonTabBar slot="bottom">
<IonTabButton tab="tab1" onClick={() => window.alert('Tab was clicked')}>
<IonLabel>Click Handler</IonLabel>
</IonTabButton>
</IonTabBar>
</IonTabs>
</IonPage>
);
};
export default Tabs;