Questions tagged [react-router]
React Router - A complete routing library for React inspired by Ember's routing system
react-router
20,554
questions
0
votes
0
answers
12
views
How can i call the object parametr inside the object
I have some array with objects and i need to define condition of style showing which connected with one of the object attribute
const location = useLocation();
const userLinks = [
{
title: ...
1
vote
1
answer
20
views
Unable to publish Reactjs Website on GitHub Pages: Error 404
I am creating a website using ReactJS and am trying to publish on github using github pages. However I am having issues:
I've seen all 404-related questions here with no luck.
My package.json:
{
&...
0
votes
0
answers
11
views
Why I can't navigate to the " event details " page Using "router.push" of next.js?
I am working with next.js 14, and after I did the submission of the event form, I haven't gotten to the event details page, it seems like the router.push doesn't work and I stay on the same page, but ...
0
votes
0
answers
11
views
An index route cannot have child routes. Why i can't pass child to index? I want 3 or 4 level nested routing in my app
NOTE:: this is a scenario that i'm describing here as i need same in real app. in my actual app, i need 3 or 4 level nested routing. i'm using index because when i'll visit the tab list1, url would ...
0
votes
0
answers
10
views
Blank page when protecting route with react router [duplicate]
I have followed several guides and questions on stack overflow with no luck.
I want to set up protected routes, so going to example /highscores would redirect user to /login if not signed in.
...
0
votes
0
answers
21
views
React useNavigate does not navigate me to the correct page, even though the URL is correct
Here is my WEbSocketListener.jsx. My component get the data.orderId correctly because the URL changes, then I call navigate but for some reason it does not work. When I refresh my page the desired ...
-1
votes
1
answer
13
views
React Component Redirects to /signin before accessToken updates [duplicate]
I'm working on a React application where I need to ensure that users are authenticated before they can access certain routes. I have a RequireAuthN component that is supposed to redirect ...
-1
votes
1
answer
40
views
How can I update URL along with rendering a component inside Modal? URL not getting updated
I created a Modal as compound component that manages all its state itself. Now I'm trying to open modal and render PostDetails component inside it. Modal getting open and component rendering as well ...
0
votes
0
answers
32
views
useOutletContext hook not working properly. sometime works and sometimes throw error
I'm passing some data to <Outlet /> from About component and there is no issue with fetching data. All data is available and ready to use. Then receiving data via useOutletContext hook. ...
-1
votes
0
answers
30
views
fallback element not coming when lazy prop is used - ReactRouterV6
I am using ReactRouterV6 to lazy load a router,
When I use lazy prop, in this case my fallback element defined in RouterProvider not coming up.
When Fallback UI Shows UP
Fallback Element only comes ...
-3
votes
0
answers
33
views
React router not running [closed]
in this code my first component is running correctly but the second one (ProuductList) is not showing up on the screen at all, any ideas?
import { Route, Routes } from "react-router-dom";
...
0
votes
1
answer
16
views
Page Not Found in Netlify [duplicate]
I am currently building a React website and I created a PageNotFound component and integrated on my Routes which works fine but when deployed on Netlify, it displays the default netlify page not found ...
-2
votes
0
answers
20
views
Ionic React App Shows Blank White Screen After Deployment on Netlify/local
I have created an Ionic React app and tried to deploy it on Netlify. However, after deployment, I encountered a blank white screen. To debug, I ran npm run build locally, went inside the dist folder, ...
-1
votes
1
answer
19
views
Passing data between pages in React Router using the Action and Loaders
Using React Router 6, and the createBrowserRouter method.
I really like the way the Loaders and Actions can separate data fetching from the React components. However, I'm unclear on how to properly ...
-1
votes
0
answers
19
views
React RouterV6 Loaders
I try to use loader data from the router in my component, the routes where the loader function is in a separate file. The data is fetched via react-thunk and axios but I can't navigate exactly to this ...