Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6ffd38b

Browse files
committed
Use <Navigate> component from react-router-dom instead of custom <Redirect> component
1 parent 90f04ab commit 6ffd38b

File tree

3 files changed

+2
-46
lines changed

3 files changed

+2
-46
lines changed

site/components/Redirect.test.tsx

Lines changed: 0 additions & 21 deletions
This file was deleted.

site/components/Redirect.tsx

Lines changed: 0 additions & 23 deletions
This file was deleted.

site/pages/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react"
22

3-
import { Redirect } from "../components"
3+
import { Navigate } from "react-router-dom"
44
import { FullScreenLoader } from "../components/Loader/FullScreenLoader"
55
import { useUser } from "../contexts/UserContext"
66

@@ -9,7 +9,7 @@ const IndexPage: React.FC = () => {
99

1010
if (me) {
1111
// Once the user is logged in, just redirect them to /projects as the landing page
12-
return <Redirect to="/projects" />
12+
return <Navigate to="/projects" replace={true}/>
1313
}
1414

1515
return <FullScreenLoader />

0 commit comments

Comments
 (0)