I am getting the duplicate records but my keys are different Is it correct which I have implemented
PrivateRouter.js
import { Outlet, Navigate } from 'react-router-dom'; const PrivateRouter = (props) => { const firstLogin = localStorage.getItem('firstLogin') return firstLogin ? : };
export default PrivateRouter;
App.js
<Routes> <Route exact path="/" element={auth.token ? <Home/> : < Login/>} /> <Route exact path="/register" element={<Register/>}/> <Route element={<Layout />}> <Route element={<PrivateRouter />}> <Route exact path="/:page" element={<PageRender/>}/> <Route exact path="/:page/:id" element={<PageRender/>} /> </Route> </Route> </Routes>
Can you please review again your post, add more context to the subject, and fix the broken code? Ping me after that, and I'll take a look!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I am getting the duplicate records but my keys are different
Is it correct which I have implemented
PrivateRouter.js
import { Outlet, Navigate } from 'react-router-dom';
const PrivateRouter = (props) => {
const firstLogin = localStorage.getItem('firstLogin')
return firstLogin ? :
};
export default PrivateRouter;
App.js
Can you please review again your post, add more context to the subject, and fix the broken code? Ping me after that, and I'll take a look!