Javascript – How to use a React-Router for checking whether to load the component or not
I have a following Router component: Router.js const Router = () => { const router = createBrowserRouter(RouteList); return ( <UserProfileProvider> <RouterProvider router={router} /> </UserProfileProvider> ); }; export default Router; routes.js function withSuspense(Component) { return ( <SuspenseWrapper> <Component /> </SuspenseWrapper> );…