Роутер Ioni c React переходит на ту же страницу на выбранной вкладке. - PullRequest
0 голосов
/ 21 июня 2020

Ниже приведен мой код вкладок маршрутизатора ioni c response. Каждый раз, когда я нажимаю на выбранную вкладку, она снова загружается в истории, как это предотвратить.

<IonReactRouter>
      <IonTabs>
        <IonRouterOutlet>
          <Route
            path="/"
            render={() => <Redirect to="/feed" />}
            exact={true}
          />
          <Route path="/feed" component={Feed} />
          <Route path="/trending" component={Trending} />
          <Route path="/profile" component={Profile} />

          <Route component={() => <Redirect to="/feed" />} />
        </IonRouterOutlet>
        <IonTabBar slot="bottom">
          <IonTabButton tab="feed" href="/feed">
            <IonIcon icon={earth} />
            <IonLabel>Feed</IonLabel>
          </IonTabButton>

          <IonTabButton tab="trending" href="/trending">
            <IonIcon icon={flame} />
            <IonLabel>Trending</IonLabel>
          </IonTabButton>
   
          <IonTabButton tab="profile" href="/profile">
            <IonIcon icon={person} />
            <IonLabel>Profile</IonLabel>
          </IonTabButton>
        </IonTabBar>
      </IonTabs>
  </IonReactRouter>
...