ClerkProvider, SignedIn, SignedOut,
UserProfile, RedirectToSignIn,
} from "@clerk/clerk-react";
useNavigate, Switch, Route,
} from "react-router-dom";
function AppWithRoutes() {
// Get the navigate method from
// the router your app is using. For this
// example we will use 'react-router-dom'.
const navigate = useNavigate();
// Pass the navigate method to ClerkProvider
frontendApi={"[your-frontend-api]"}
navigate={(to) => navigate(to)}
{/* Define a /user route.
If a user is signed in, they will see
the user profile, otherwise thet will get
redirected to the sign in page */}
<UserProfile routing="path" path="/user" />
{/* Home route that links to user profile */}
<h1>Go to user profile</h1>