When I learned permission routing in react-router, navigate dealt with the jump issue
Navigate component throw an error Unexpected token, expected "," Why display symbol problems?
Detailed errors are shown on the picture above,Could someone help me with this
This is the source code of the error file
import React from 'react';
import { Navigate, useLocation } from 'react-router-dom';
const IsAuth = () => {
if (true) {
return <Navigate to="/login" />;
}
};
export default IsAuth;
i use IsAuth.jsx in index.tsx
import IsAuth from './Login/IsAuth';
const createRoutes = (
(xxxxxx)=>{
...
return (
<IsAuth>
<Routes>
<Routes/>
<IsAuth/>
);
}
)
export default createRoutes;