react-router Questions
16
I'm seeing the following error when I dismiss a particular modal:
This didn't happen when I was using react-router v5, but I've recently updated to v6 due to other requirements and it started happ...
Weddle asked 6/5, 2023 at 5:19
5
I have a react app created with create-react-app and am using react-router-dom for routing.
The general layout is:
App.js
<BrowserRouter>
<BodyContent />
</BrowserRouter>
Bo...
Bimetallism asked 10/10, 2018 at 22:50
2
Solved
Dear fellow React developers.
Can someone explain or show what should be the best approach whilst using MSAL in conjunction with React Router in its current latest version 6.4.1 when you want to us...
Hinrichs asked 27/9, 2022 at 18:47
7
Solved
I am basically trying to intercept route changes. Maybe something equivalent of vue's beforeEach in React Router v6 could be useful as React Router v.6 does not include usePrompt.
BEFORE each route...
Kierkegaardian asked 22/3, 2022 at 13:13
10
Currently, doing setSearchParams(/* an object */) will replace the existing search params. If I would like to extend the search params instead of replacing them, e.g. adding a new param. What will ...
Wellman asked 13/12, 2021 at 4:19
4
Solved
I migrated from React Router v5 to v6 following this tutorial. I want to test it with react-testing-library, but my old unit tests (using the pattern in this doc) stopped working.
My app with React...
Selective asked 11/11, 2022 at 7:53
2
Solved
I have a component that I am using in React Router v6 for managing private routes, that does some checks on an auth token, and will either render the Outlet component or will redirect to a login pa...
Foy asked 10/1, 2022 at 15:30
10
Solved
I am using react-router 2. My routes are defined as
<Route path="/" component={App}>
<IndexRoute component={Home}/>
<Route path="/about" component={About}/>
<Route path="...
Dodson asked 21/3, 2016 at 20:58
2
Solved
We are about to deploy our site in reactjs and we have (re)moved one url but merged it in our main page so from /[product]/menu we merged it to /[product]. Now they said I should respond with 301 f...
Stelmach asked 23/5, 2016 at 10:17
8
Solved
I have a route which takes an id and renders the same component for every id, for example :
<Route path='/:code' component={Card}/>
Now the in the Link tag I pass in an id to the component...
Stevie asked 10/9, 2018 at 6:41
4
Solved
I have a React Application and I wish to deploy this behind a load balancer, where the load balancer periodically pings the app to see whether it's healthy. My requirement is to provide a /health e...
Android asked 28/4, 2020 at 19:4
6
I'm a newbie to NextJS, It looks so good on the first impression.
But after giving it a chance I've faced some problems like URL routing with custom params like react-router.
Currently what We can ...
Deficit asked 3/4, 2017 at 9:57
10
How to scroll to top on route change with react router dom v6?
I have tried this, react-router scroll to top on every transition, which was my solution to make my page scroll to top on route change...
Babs asked 2/12, 2021 at 2:59
3
Error: A component suspended while responding to synchronous input.
This will cause the UI to be replaced with a loading indicator. To
fix, updates that suspend should be wrapped with startTransit...
Communist asked 9/5, 2022 at 5:57
5
Solved
I'm trying to deploy a create-react-app to a relative path on GitHub pages with a custom domain. E.g. www.example.com/myproject
I'm using react-router-dom, react-router-redux and react-router-boot...
Thoughtless asked 5/9, 2017 at 13:37
5
Solved
I'm using the default dynamic routing technique of nextjs in my project which is based on the folder structure. I have a route which is:
pages/[language]/location/[location_id]
Now I'm coming a...
Kirschner asked 6/3, 2020 at 14:16
4
Solved
I am using Link component from react-router-link which applies blue color css to the text just like an anchor tag does. I want to change this to white, how can I do that?
onHover I want to change ...
Bringingup asked 7/9, 2017 at 18:3
3
Solved
I want in react router 6 to show an placeholder when there is no outlet. Is there any way?
<>
<Grid item xs={12} sm={2} style={{backgroundColor: '#aaa'}}>
<Button onClick={() =>...
Incertitude asked 15/12, 2021 at 10:30
3
Solved
I am trying to mock react-router-dom in one of my test cases so that the useHistory hook will function in my tests. I decide to use jest.mock to mock the entire module, and jest.requireActual to pr...
Selfdenial asked 7/7, 2020 at 12:7
38
I am having trouble changing the view in react with routing. I only want to show a list of users, and clicking on each user should navigate to a details page. Here is the router:
import React from...
Cantatrice asked 11/4, 2017 at 16:42
20
Solved
I've just started learning React and got stuck at this error.
Uncaught TypeError: Cannot read property 'pathname' of undefined
at new Router
Here is my code:
var React = require('react');
...
Bushy asked 25/4, 2017 at 20:23
7
Solved
could you please tell me how to render a list in react js.
I do like this
https://plnkr.co/edit/X9Ov5roJtTSk9YhqYUdp?p=preview
class First extends React.Component {
constructor (props){
super(pro...
Rachellrachelle asked 29/12, 2016 at 6:51
9
Solved
I'm trying to setup a react-router for my first React webapp, it seems to be working except that the css doesn't load for my nested pages when I refresh the pages.
However it works for just one l...
Abbotsun asked 4/11, 2016 at 15:10
23
I can see in this file (https://github.com/ReactTraining/react-router/blob/v0.13.3/modules/createRouter.js) that there is a refresh function but I have no idea how to call it. I'm fairly new to rea...
Corpse asked 18/10, 2017 at 23:24
11
Solved
Using this boilerplate as reference I created an Electron app. It uses webpack to bundle the scripts and express server to host it.
Webpack config is practically same as this and server this.
Ele...
Allfired asked 8/4, 2016 at 17:7
© 2022 - 2025 — McMap. All rights reserved.