mirror of
https://github.com/usatiuk/photos.git
synced 2025-10-28 23:37:48 +01:00
fix animations
This commit is contained in:
@@ -4,12 +4,16 @@ import { AuthScreen } from "~Auth/AuthScreen";
|
|||||||
import { requireAuth } from "~Auth/AuthWrapper";
|
import { requireAuth } from "~Auth/AuthWrapper";
|
||||||
import { Home } from "~Home/Home";
|
import { Home } from "~Home/Home";
|
||||||
|
|
||||||
|
// Somehow, if we do it like this then App doesn't rerender every time
|
||||||
|
// the route changes, and animations work
|
||||||
|
const protectedHome = requireAuth(Home);
|
||||||
|
|
||||||
export const AppComponent: React.FunctionComponent<RouteComponentProps> = () => {
|
export const AppComponent: React.FunctionComponent<RouteComponentProps> = () => {
|
||||||
return (
|
return (
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route path="/signup" component={AuthScreen} />,
|
<Route path="/signup" component={AuthScreen} />,
|
||||||
<Route path="/login" component={AuthScreen} />,
|
<Route path="/login" component={AuthScreen} />,
|
||||||
<Route path="/" component={requireAuth(Home)} />,
|
<Route path="/" component={protectedHome} />,
|
||||||
</Switch>
|
</Switch>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user