react-router Questions

3

I want to link from one view to another and then scroll to a specific element. I'm not intrested in any animations, only want to have the element in view. The link from one view to another is done ...
Ermeena asked 22/4, 2022 at 21:40

3

Solved

I have the below component as the main layout. When I click on the menu item, I want them to navigate to the home, holiday calendar, and event pages. What can I do with this horizontal menu? The be...
Munoz asked 6/11, 2022 at 18:34

10

Solved

Trying to deploy for the first time to firebase , I looked in alot of guides on youtube and stackoverflow did the same as they did but keep getting blank page after deploy the app. This is my proc...
Mapel asked 17/2, 2020 at 20:6

7

Solved

I have a problem using MUI with react-router-dom v6. import ListItem from '@mui/material/ListItem'; import { NavLink } from 'react-router-dom'; <List key={index}> <ListItem component={N...
Softspoken asked 4/3, 2022 at 11:2

5

When I add routing with React Router to my React app, it throws error and shows warning: Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could ...
Overwrite asked 15/7, 2022 at 14:11

3

Solved

This is my primary react file: // App.tsx const App: FC = () => { const isLoggedIn: boolean = localStorage.getItem('logged_user') !== null; return ( <BrowserRouter> <Routes> &...

3

I have a simple React + Vite project that I deployed on Vercel for the first time for fun. But whenever i hit refresh on a sub-route, it sends me to a 404 page. I'm using react-router-v6 for ...
Geffner asked 8/4, 2023 at 7:2

4

I'm using react-router-dom v6. When using useNavigate like this: let navigate = useNavigate(); navigate("/", {state: state}); I can access it by useLocation().location.state My question ...
Kidding asked 5/5, 2022 at 2:21

10

I am facing a problem. I am trying to use React Router but it keeps showing me a blank page. Here is my code: App.js: import React from "react"; import { BrowserRouter as Router, Routes, ...
Helli asked 5/2, 2022 at 13:7

3

Solved

I just implemented a global search in my website and I started having issues with React-Router. It is not updating the view if the url changes parameters. For example, navigating from /users/454545...
Cheese asked 10/7, 2020 at 14:23

4

Solved

I am trying to implement a home page for my react.js website. My layout is fine and my code compiles without problems. However when I click my button I am getting the following error on the website...
Suchta asked 23/11, 2021 at 1:49

5

Solved

I would like to redirect my url for e.g to '/questions/1' when I only write /questions

4

Solved

I have this little app that works fine in development mode with webpack-dev-server, but when I use the bundled files from the dist folder generated by the production mode, all I get in the browser ...
Jea asked 27/4, 2019 at 14:38

3

Solved

I have a simple React.js application with wouter-based routing and Vercel deployments that drive me into a little issue where I have no idea about the solution. It always returns 404 after refresh ...
Interknit asked 26/1, 2022 at 21:52

17

Solved

I am trying to publish a serverless web to vercel. I want to use react-router and this works good on my computer but when I deploy it It doesn't works Can somebody help me? (I want to do it without...
Bathometer asked 13/11, 2020 at 3:20

7

Solved

I'm using react-router v6. I want to navigate to a URL that has searchParams, but I'm not seeing a way to do this out of the box. useNavigate allows me to navigate to a URL by passing in a string. ...
Wabash asked 19/1, 2021 at 22:48

5

Solved

In one component, there is a <Link> (from react-router-dom) passing an object in the state property. Another component called ReceiverComponent is receiving that object correctly. However, t...
Galata asked 8/3, 2020 at 10:46

6

My problem is Crawl in Google Search Console can't found sub-routes in React. The URL is https://huynhsamha.github.io/crypto, and crawler can fetch and render homepage (route /) and static files s...

3

Solved

I just deployed my react app build on c-panel. The app includes different routes and everytime I try to get to one of them I get 404 Not found. For example if I try to get to http://example.com/ it...
Counterpart asked 27/5, 2020 at 15:55

5

Solved

I'm trying to understand how to best test that react-router behaves as expected with @testing-library/react. The simplest test I can think of, is to verify that clicking a link changes the URL. I ...
Neonate asked 18/5, 2020 at 12:45

5

Solved

I deployed a React website using GoDaddy (http://normaned.com), and I’m having trouble with my react-router routing not working upon refresh. Clicking on links works as expected, but if a page is r...
Cyan asked 18/10, 2019 at 14:25

3

What is the difference between React router.push and router.replace?
Frampton asked 23/10, 2018 at 17:35

4

Solved

I have an app, and I want the app component to hold the current logged in user. I have the following routes and components. Basically, every component in my app will make use of the user object. Su...
Agustinaah asked 22/10, 2021 at 10:33

2

Solved

I'm using React Router v6 and following are my routes: const router = createBrowserRouter([ { path: '/', element: <App />, errorElement: <ErrorPage />, children: [ { index: true,...
Bedpan asked 1/6, 2023 at 19:13

6

Solved

I'm new to React and trying to make a loading/greeting page that navigates on to the next after a few seconds of being shown. In React Router v6, we have the useNavigate() hook to allow you to cont...

© 2022 - 2024 — McMap. All rights reserved.