Open yeongipark opened 4 months ago
export const ProtectedRouter = ({ children }) => { return localStorage.getItem("login") ? <>{children}</> : <Navigate to="/" />; };
<Route path="/myHomeTrainList" element={ <ProtectedRouter> <HomeTranList /> </ProtectedRouter> } />
ProtectedRoute란?
구현 방법
사용법