Link to the test app: https://creators-dashboard-nirav6.developers1.vercel.app/
App animates/flows perfectly when using no conditional rendering, but as you can see in the gif it animates 2-3 times when logging out and logging back in to the app.
Problems I’ve noticed:
- animation occurs 2-3 times
- ‘/dashboard/statistics’ route display full black
Solutions I’ve tried:
- conditional rendering the routes
- confirmed the
<IonPage> and <IonContent>
tags on all the pages.
Code for Navigation:
<IonApp>
<IonReactRouter>
<IonSplitPane contentId="main">
<Menu />
<IonRouterOutlet id="main">
<Route exact path="/">
<IntroductionPage />
</Route>
<Route exact path="/login">
<Login />
</Route>
<Route exact path="/dashboard/statistics">
{loginInfo.isLoggedIn ? <Statistics /> : <Redirect to="/login" />}
</Route>
<Route exact path="/dashboard/earnings">
{loginInfo.isLoggedIn ? <Earnings /> : <Redirect to="/login" />}
</Route>
<Route exact path="/dashboard/about">
{loginInfo.isLoggedIn ? <AboutForm /> : <Redirect to="/login" />}
</Route>
<Route exact path="/dashboard/settings">
{loginInfo.isLoggedIn ? <Settings /> : <Redirect to="/login" />}
</Route>
<Route exact path="/dashboard/connect">
{loginInfo.isLoggedIn ? <AccountConnect /> : <Redirect to="/login" />}
</Route>
</IonRouterOutlet>
</IonSplitPane>
</IonReactRouter>
</IonApp>