Most voted "react-router-dom" questions
17 questions
Sort by count of
-
3
votes1
answer65
viewsWhy is my route in React /#/?
I created a route structure with Hashrouter in React and everything works fine, but my route always http://localhost:3000/#/ + a rota. return ( <div> <HashRouter> <Switch>…
-
2
votes1
answer740
viewsHow to receive query params in React with reatc-router-dom?
I’m making an App, using React with typescript and React-router-dom. But I’m having a hard time working with query params on routes. My initial goal was just to receive the token and email that…
-
1
votes1
answer1034
viewsWhen using history.push() my component does not render, you need to re-load the page to render
I’m using React-router-dom to work with routes in an React application. I have a file called Approuter.js that has my routes: const AppRouter = props => { const loading = useSelector(state =>…
-
1
votes0
answers28
viewsPrevent state from being lost when using history.push() - React-router-dom - Reactjs
I have a component that calls the API and stores the return in the state to display to the user. However, when I use the history.push() to navigate to another application page and then use the…
-
0
votes1
answer37
viewsUse useEffect every time my Location.pathname is changed
I have a variable called nameScreen that I need to change its value every time the location.path is changed (whenever there is a route change): <Typography variant="h6" noWrap> {nameScreen}…
-
0
votes1
answer383
viewscreate routes with React-router-dom
The situation is this, I’m using the React-router-dom in an app in Reactjs, I’m learning to use Reactjs. So I create two 'Logon' and 'Welcome' routes, but every time I use React-router-dom I can’t…
-
0
votes2
answers47
viewsWhen I use the <Link> it from this route error, what can it be?
I’ve reinstalled React-Router-Dom, and I can’t fix it.…
-
0
votes0
answers62
viewsScroll bar does not load correctly when changing page with Reactjs
I have a problem with an application in Reactjs, I am using the library React-router-dom to navigate between pages, and when switching pages in my application when the page component is too large…
-
0
votes1
answer203
viewsHow to redirect to an external url using React useEffect?
I am trying to redirect to an external url ,using the vaiparala function by passing a parameter that I pick up from the click, the path arrives at the function correctly but the redirect does not is…
-
0
votes2
answers73
viewsSend custom property to Privateroute component in React
Problem: Basic information: React project with the following dependencies.: "dependencies": { "@emotion/core": "^10.0.35", "@fortawesome/fontawesome-free": "^5.14.0",…
-
0
votes1
answer63
viewsReact - React-router-dom repeating components
I am developing a login/registration page in React, however, I came across the following problem: <div className="auth-container"> <BrowserRouter> <Hint /> <Switch> <Route…
-
0
votes2
answers40
viewsHow to persist on a route using React router with Reactjs?
I have a site in React, and would like to know how to persist on a route. For example: When I’m on the profile page and refresh the page, it redirects me to Dashboard. Does anyone have any idea how…
-
0
votes2
answers35
viewsHow to create a React component that receives a query string and then make a request?
Hello, I’m having a hard time getting a page on React to work. This page receives a query string with token and email, where I should pick them up and make a request for the account to be validated,…
-
0
votes0
answers38
viewsHow to get the path of the current route of the React-router-dom with the same parameters and just update the route?
I’m developing a dropdown, and each dropdown item will have a link to redirect to the same page, which will change are the parameters on it. I want to know how to get the full URL already with the…
-
0
votes0
answers10
viewsRoute redirection in REACTJS
I have an React app that has public route (Login), private routes (Dashboard) and sub routes, which are the contents according to menu options. This is an Aside that holds the menu, and the right…
-
-1
votes1
answer52
viewsProblems with React-router-dom Withrouter
If you turn on, I started making an app and I needed a header menu for the transition, this would be a menu that is rendered on every page. That is why it was created and is ultimalized outside the…
-
-1
votes1
answer25
viewsHow to define the component to be rendered in the React-Router-Dom Link?
According to the documentation, it is possible to render a custom element in the React-Router-Dom Link: If you would like use your Own navigation Component, you can Imply do so by Passing it through…