I have the following route structure:
const CustomRoute = ({ Component, path, url }) => {
if (!document.referrer.length) {
return <Navigate to={url} />;
}
return <Route path={path} element={<Component />} />;
};
<Router basename={config.historyBasename}>
<Routes>
<CustomRoute
Component={Activate}
url={routes.landingPage}
path={routes.userActive}
/>
</Routes>
</Router>
Here I am using it like this. But I am getting an error. So, How can I fix this?