Questions tagged [react-router]
React Router - A complete routing library for React inspired by Ember's routing system
react-router
20,546
questions
-2
votes
1
answer
28
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
13
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 ...
-1
votes
0
answers
14
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
17
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
16
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 ...
-2
votes
0
answers
27
views
invalid hook call. Hooks can only be called inside of the body of a function component. this of the fowwing reason
Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the ...
-1
votes
0
answers
17
views
Issue with useParams in React Router on iPhone Chrome Browser
I am experiencing an issue with useParams in the latest version of React Router on the latest iPhone Chrome browser. The issue occurs intermittently and seems to affect the retrieval of route ...
0
votes
1
answer
49
views
React Router: Nested Route Not Rendering -- How to structure properly?
I'm working on a React application using React-Router for navigation. I have a nested routing setup for displaying scoreboards where you can click on it to get the full details, but I'm facing an ...
3
votes
2
answers
47
views
How to go to a page clicked on a hamburger menu?
I'm starting with an existing project called react-burger-menu.
https://github.com/negomi/react-burger-menu
It uses a hamburger menu sidebar for navigation. Unfortunately, the demo code does not show ...
1
vote
2
answers
44
views
useLocation Hook Error: "useLocation() may be used only in the context of a <Router> component" in React Application [duplicate]
I'm developing a React application and I'm encountering an error when using the useLocation hook from the react-router-dom library. The error message I receive is:
Error: useLocation() may be used ...
-1
votes
0
answers
21
views
React Routing on WordPress with ReactPress
I was trying to build a SPA website using React and WordPress (local environment).
I have successfully installed and configured the ReactPress plugin and created the React App via create-react-app.
(...
-1
votes
2
answers
114
views
ReactJS: How to Retain Scroll Position at top When Navigating Between Pages in ReactJS? [duplicate]
I'm encountering an issue in my ReactJS application where, upon navigating to a new page, the page automatically scrolls down to a position below the top of the page instead of starting from the top (...
0
votes
0
answers
15
views
React Router 6.4
I'm trying to create a dashboard page. I want the user to see the dashboard only when they are logged in, else direct to login page.
1- If user manually try to enter any other url that is not valid, ...
-1
votes
0
answers
22
views
How to enable react client side routing with nextjs static export SPA?
I have built a single-page app using Nextjs and it is exported as a simple static page which means no server-side rendering or Node.js backend, so everything runs on the client side as soon as the ...
-1
votes
0
answers
29
views
How to Render a Modal Route on Top of Current Page Content Using React Router?
I'm working on a React application where I need to render a settings modal on top of the current page content when navigating to the /setting route. I want the modal to overlay on top of whatever page ...