Last active
November 5, 2022 13:33
-
-
Save WNortier/603b363ac8c32437fbcfe2955d4d21df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Route path="/profile/:username" element={<ProtectedRoute user={user}><UseParamsExample /></ProtectedRoute>} /> | |
import { useNavigate, useParams } from "react-router-dom"; | |
const UseParamsExample: React.FC = () => { | |
let navigate = useNavigate(); | |
let { username } = useParams(); | |
return ( | |
<div className="profile"> | |
Profile: {username} | |
</div> | |
); | |
} | |
export default UseParamsExample |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment