Skip to main content

All Questions

-3 votes
0 answers
39 views

My navigation bar menu is not active again after navigating to a page

Whenever I navigate to the Contact us page or About us page, I cannot navigate to another page again from that page unless I reload the app or go back to the homepage. I notice it happened when I was ...
Duke 's user avatar
1 vote
1 answer
77 views

How to set basename for react-router v7 framework mode?

I have created a React-Router framework mode app like this: npx create-react-router@latest my-react-router-app The version of React-Router is: "react-router": "^7.5.1" In routes....
RajV's user avatar
  • 7,232
-1 votes
0 answers
33 views

how to use hooks like useLocation with @react-router/fs-routes [closed]

I have a react app using react-router / nx / vite. When I setup the project, I choose ssr: true, and I now have the following react-router.config.ts import type { Config } from "@react-router/dev/...
Federico Giacomini's user avatar
2 votes
1 answer
67 views

I cannot figure out why ProtectedRoute wont re-render after updating useState

I would like the ProtectedRoute to call server and get a response that indicates whether the user is logged in or not, on every render of a page that it protects. The server is sent a session cookie ...
user3146945's user avatar
0 votes
0 answers
21 views

Route Transition Flickering in React Router Framework v7 (Private Routing) [duplicate]

I'm currently developing a project utilizing React Router v7 framework where I need to implement protected routes. While I've successfully implemented the protection mechanism, I'm encountering an ...
PROFESSOR MR's user avatar
-1 votes
1 answer
50 views

How come visiting child component loses functionality?

I have an app that has a 3 JSX files: one for controlling states import React from "react"; import CreateRisk from "./CreateRisk"; import TablePage from "./TablePage"; ...
Aleks3000's user avatar
-1 votes
1 answer
94 views

react component is not displayed with react router v7

I do function PrivateRoutes() { const user = useAuth(); return user.token ? <Outlet /> : <Navigate to="/login" replace />; } const routes = (isInstalled: boolean) => [ ...
Vana's user avatar
  • 938
1 vote
1 answer
36 views

Redirect when path parameter is not provided in react-router-dom

I have the following routes defined in react-router-dom <Route id='editor' path='editor' > <Route index element={<Editor />} /> <Route id='edit' path='edit/:documentId' ...
Greeso's user avatar
  • 8,309
1 vote
1 answer
65 views

React Routes Question about routes with same path and components

In my React code I have these 2 files in App.js and Users.js. By using Routes just for fun and experimenting to render some random text, I have 3 routes that have the same path and components but ...
Oh Oh's user avatar
  • 45
-4 votes
1 answer
102 views

createMemoryRouter throws TypeError: Cannot destructure property 'basename' of 'React10.useContext(...)' as it is null [closed]

Using createMemoryRouter to create router to render doesn't work. It renders and error page. import { vi, describe, it, expect } from 'vitest' import { render } from '@testing-library/react' import { ...
vatsal chauhan's user avatar
-1 votes
1 answer
218 views

How to integrate MUI Toolpad's PageContainer with a custom Sidebar?

Material UI has a component called PageContainer which provides a title and breadcrumb navigation as shown here: https://mui.com/toolpad/core/react-page-container/ I want to navigate to the same place ...
user3217883's user avatar
  • 1,485
1 vote
2 answers
153 views

I'm using React Router v7.20 and getting this error in my Account.jsx component [closed]

The error happens when I refresh the page or navigate between "/account", "/account/bookings", and "/account/places". import React, { useContext } from 'react'; import { ...
Ujjwal Gaihre's user avatar
0 votes
1 answer
260 views

React Router v7 splats paths migration issue

I'm trying to create a scenario for migration of React-Router from version 6 to version 7. I have followed the migration steps of the documentation but the routing is not working. I'm stuck and can't ...
Apostolos's user avatar
  • 10.5k
-1 votes
1 answer
46 views

How can I prevent my list component from remounting when using modal routes with HashRouter in React Router v5?

I’m adjusting some functionality for a React app (using React 16.13.1) with React Router v5 and HashRouter. My app displays a list of coupons in a table (using AgGrid) within a component (named ...
Varikash Nikolay's user avatar
1 vote
1 answer
55 views

Why can’t I use <GameRoutes /> as a component inside <Routes> in React Router?

I am currently creating a routes folder to better organize my project as it grows. I created a file named GameRoutes.jsx, but when I import and use it in my App.jsx, I cannot use it as a component <...
Sarriod Netium's user avatar

15 30 50 per page
1
2 3 4 5
499