Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
444 views
in Technique[技术] by (71.8m points)

reactjs - Ionic/React - IonRouterLink clearing redux store

I'm developing an Ionic-React app using IonReactRouter and Redux.

It appears that when I use IonRouterLink I lose the content of my redux store.

To clarify further: In my router component:

<IonReactRouter>
      <IonTabs>
        <IonRouterOutlet id="main">
          //...
          <Route
            path="/page/:pageId"
            component={Page}
          />
          //...
        </IonRouterOutlet>
      </IonTabs>
</IonReactRouter>

In a different component:

<IonRouterLink href={`/page/${pageId}`}> //...

The result onClick for that IonRouterLink element is an empty redux store.

It seems like I can side-step the issue by using a custom component w/ history.push(path), but does anyone have any better ideas for maintaining the store without a custom-fix?

Thanks in advance!

question from:https://stackoverflow.com/questions/65837533/ionic-react-ionrouterlink-clearing-redux-store

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...