Most voted "react-router" questions
62 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>…
-
3
votes2
answers19646
viewsHow to redirect to a route using onClick and React Router
I have a screen (in React.js) called Cadastro.js. In it I have a form and the button register By clicking this button, I wanted you to direct to the login screen, which is the Login.js. How do I do…
-
3
votes2
answers201
viewsReact Switch Route Default
I’m creating an app in Nodejs, React & Redux here at the company. And I have a page that is Content, in it I have two navigation bars and a common area for content. In this common area I’m using…
-
3
votes1
answer685
viewsHow to get the url parameter in Nextjs
Guys, I have a question on Next JS, I have a page with name listid.js, when accessing for example http://localhost:3000/listid/10 I would like to receive id 10 as parameter on my page listid.js:…
-
2
votes1
answer174
viewsReact class constructor error
I have the following error when I try to use Component in this way. client?cd17:119 ./src/App/Components/AddNote.js Module build failed: SyntaxError: super() outside of class constructor (9:4) 7 |…
-
2
votes1
answer361
viewsCreate routes using React Route
Next I’m using the React-router-dom while I’m serving the project folder as if it’s root works, the routes go to the specific components my problem is when I put in a server: the front part where…
react-routerasked 7 years, 1 month ago Honório Neto 21 -
2
votes1
answer987
viewsReact Router: Use more files with routes
I have a question regarding the use of React Router, I could have several files for example, main.js, stock.js and bank.js and each file have its Router ? getting something like: main.js import…
-
1
votes1
answer720
viewsReact-router not rendering pages not found correctly
I’m developing an application using React + React-router + Express to render to the server and injecting it into an EJS view. It is working properly, but I noticed that when not finding a route as…
-
1
votes0
answers131
viewsGet data by POST on Reactjs
When I need to capture data in Reactjs via querystring, I use the command this.props.match.params.[NOME_DA_QUERY]. Does anyone know how to capture when this data comes by POST?…
-
1
votes1
answer240
viewsProblem to change class in React that has Responsive Bootstrap Menu
I’m making a site with Bootstrap and Reatjs and this site has a responsive menu. This menu looks like this (example): Dashboard Register User Administrator Every time I click on one of the menu…
-
1
votes0
answers109
viewsReact with React Router / Dynamic Configuration
I have two questions about routes, in the scope of my project, I would have to assemble it according to the json that arrives, because it can come with a different component tree. I would have…
-
1
votes1
answer36
viewsReact-Native Route Flux does not work
I tried to do everything, when I compiled after having installed the Flux Router, an error appeared saying that I was in need of some modules, such as React-Native-Gesture-Handler and…
-
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…
-
1
votes1
answer331
viewsReact Native request the api via navigation response
Main.js import React, { Component } from 'react'; import api from '../service/api'; import { View, Text, FlatList, TouchableOpacity, StyleSheet } from 'react-native'; export default class Main…
javascript react react-native react-router react-navigationasked 5 years, 9 months ago Felipe Santos 96 -
1
votes1
answer217
viewsHow to keep setState using Router in React?
I’m starting my studies with React and needed a help: I have an application that shows a list of "solutions". It also has a button that goes to a new page (which I programmed via Router) able to add…
-
1
votes1
answer500
viewsCrud ID with javascript
import api from '../../services/api' export default function Area() { const [ area, setArea ] = useState([]) useEffect(() => { async function loadArea() { const response = await api.get('/area')…
-
1
votes0
answers118
viewsReact + React Router + Laravel => error while performing refresh or insert url manually in browser
I’m using React for the front of an application in Windows. In React, through the React-router I am accessing components dynamically through the parameters passed via url by the router link. If you…
-
1
votes2
answers96
views[[Promissevalue]] React
I’m doing a get an api on Nodejs, only the result is coming back within a [[Promisevalue]], how do I access it directly? With async and await it works, but when for it to authenticate on the route…
-
1
votes1
answer583
viewsReact-router <Redirect> does not work
I’m doing an application in React and I want to make a check, if the guy is authenticated, redirect directly to Home, if not, goes to the Login screen, this is the Code: userReducer.js const…
-
1
votes1
answer1119
viewsJWT Token Refresh
I have an API that issues a JWT token with a maximum validity of 2h per token, after which it is no longer processed by my application. I need that every time this token is expired, a new token is…
-
1
votes3
answers1189
viewsHow to structure React Js folders and files?
I’m starting to learn React Js and I’m intending to create a website on it, but I was left with a question. The React Js is the component base, right? I have the App.js where I call my own…
-
1
votes1
answer56
viewsReact JS Lifecycle Problem
Good night! I’m in the development of a page that has three buttons. The first button (Publications) renders this content: The second Button(Jorys) renders this second content: And the third…
-
0
votes1
answer1022
viewsStatic routes in React for two separate pages
The situation is this, when creating an app with React + webpack I have an html file, being it an index.html that loads a Bundle.js (default webpack) to be displayed in the browser, but my app needs…
-
0
votes1
answer2263
viewsWarning: validateDOMNesting(...): <a> cannot appear as a Descendant of <a>
Hello, I’m trying to use the component Link of react-router-dom to generate links in a data table, however, I am facing the following problem: Warning: validateDOMNesting(...): <a> cannot…
-
0
votes1
answer1187
viewsHow to get json data with React, fetch and Rest api?
I’m doing some studies with React, and for that I’m pulling a JSON from Restapi Wordpress. When I put something like fetch("https://pulsemaker.com.br/wp-json/wp/v2/posts/179") It works just fine,…
-
0
votes1
answer1034
viewsPass match.params into another component
I have the following problem: I have a step component and inside that component I have another component called form that renders one of the step steps. Well, on step I can get the id passed with…
-
0
votes1
answer546
viewsRender components according to route
I am developing an application with React. I have the index.jsx file below: import React from 'react'; import { render } from 'react-dom'; import { Provider } from 'react-redux'; import { store }…
-
0
votes1
answer1106
viewsUrl query Reach Route - React
I have the following problem: I have an API in Node.js that returns me id and name of products and supermarkets When I get into /supermarkets via params url /:idSupermercado I can get this parameter…
-
0
votes1
answer116
viewsHow to navigate with React-router-dom when an action occurs
Hello, I’m starting to work with React and I’m doing an integration with Firebase. My problem is this, I can already fire all the actions I need, but when I fire my last action…
-
0
votes1
answer1118
viewsReactjs Private Routes and React Router
You can implement private routes by receiving a JWT token in the header and body information in Reactjs with React Router?
-
0
votes0
answers122
viewsuse props.match.params in a class
I would like to use a function that is within a class, but I would like this function to use the props.match.params to rescue the id of the product in the URL, to know which product the function…
-
0
votes1
answer971
viewsHow to pass values to another component on routes?
I have a login page, which authenticates by token and soon after, with the user and password entered are returned the user data. Soon after that I redirect the user to a component called Dashboard.…
-
0
votes1
answer526
viewsReact Route without link
I am starting my studies with React and I am using React Router to navigate between pages by clicking on links in the menu, but I have a question, how do I access a page without a link ? How do I…
-
0
votes1
answer104
viewsLogin React Native + Firebase error using "Switchnavigator"
Error (Undefined is not a Function (near '...(0, _reactNavigation.Switchnavigator)...')) when compiling application. I need that when logging in is directed to the screen "Main". import React from…
-
0
votes2
answers2621
viewsRedirect to "Home" screen after login validation - React Native + Firebase
I need to implement in the code below the command so that the user is validated is redirected to the screen "Home". The changes I’ve made haven’t solved my problem. I can create the user, save in…
-
0
votes0
answers41
viewsNested components and error rotation
Guys are developing a system in React that will consume a Rest api in Django. For development I am using the React, React-router-dom, mdbreact. I was making a form to create user account and when I…
-
0
votes1
answer41
viewsTitle on the back button
import React, { Component } from 'react'; import api from '../service/api'; import {View ,Text, StyleSheet, Image, FlatList, Dialog} from 'react-native'; import Cabecalho from…
-
0
votes1
answer481
viewsRedirect after post in api with Reactjs files
Good morning, I am trying to create a login screen in Reactjs where a post is done on an api, after sending the user email and password, the API returns the JWT authentication token. API post in my…
react login react-router react-dom reactive-programmingasked 5 years, 5 months ago Daniel Pelissari 55 -
0
votes1
answer54
viewsDoubt about React-Router
My App.jsx has a Browserrouter with Nav, Footer and between them the Routes, but I want a /admin that does not render the Nav and Footer. But necessarily when I add /admin to the Routes it pulls Nav…
-
0
votes1
answer203
viewsSide Menu is not displayed in the app made in React-Native
I’m developing an APP in React-On, I need to display a menu-left side. Although it does not display any error message, the side menu does not appear. I am using React-navigation-Drawer to create the…
android react react-native react-navigation react-routerasked 4 years, 11 months ago alexjosesilva 3,119 -
0
votes1
answer212
viewsPrivate routes with reactjs?
I’m trying to create private routes with ReactJs, but always gives the same error, I’ve been on several sites and always do according to each tutorial, but still the same error continues: My code is…
-
0
votes2
answers1538
viewsUpdate useEffect from the navigation.goBack page?
I’m developing a App in ReactNative using Expo, but I can’t update the useEffect(() => {}, []) of the previous route from navigation.goBack(). Example: Here time the Index page. function Index(){…
react-native react-navigation react-router react-hooks expoasked 4 years, 7 months ago Jéfferson Maurício 73 -
0
votes1
answer45
viewsReact Navigation | How to use Navigation inside an React component?
I have an app with a main screen where everything should happen. I am using the lib React-calendars to render the calendar and below there is the content of the application, which would be divided…
-
0
votes0
answers69
viewsNavigation error with React Native
I’m developing an application in React Native with three types of browsing: Drawer, Bottom Tab and Stack Navigator. I entered these three types of navigation but shows the following error: He says I…
-
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
votes0
answers27
viewsI can’t get the props or the api data to mount the page
Guys I’m having trouble with React with nextjs using Hooks with props , I set up a Carousel that shows several cards that use a map api to mount the cards and passes to Carousel , only when I click…
javascript-events react-hooks react-router maps-javascript-apiasked 3 years, 11 months ago Everton Costa Souza 19 -
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
votes0
answers20
viewsSite Javascript stops working when using history.push for another page
When using the; <a href onClick={() => history.push(`/about`)}> Javascript stops working by locking the page slides and other objects that depend on it. I put javascript in public/js and…
-
-1
votes2
answers817
viewsIs it possible to pass parameters from one route to another without going through the url in reactjs?
I’m learning reactjs and in the application I’m developing I have a login screen that authenticates the user to access a private route. On this private route I would like to load this user’s data…
-
-1
votes1
answer267
viewsLogin with CPF with Nodejs, Reactjs and Mongodb
Well I built an API for registrations in the remote mongodb database (Atlas), I can register, the intention is to offer a form for the user data(Name, Cpf, phone) and then do the CPF, made the login…