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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…