Questions tagged [react-routing]
70 questions
1
vote
1 answer
Navigating components without routing in React/Redux
This might be convoluted, so bear with me. I'm just beginning to learn React/Redux and managing state. I want to build a small app which does not use routing which looks like this:
Not unlike an install wizard.
A user would be prompted to answer a…

dsp_099
- 5,801
- 17
- 72
- 128
1
vote
0 answers
Route is not rendering component
Here is my code
index.js
import React from "react";
import ReactDOM from "react-dom";
import { Route, BrowserRouter } from "react-router-dom";
import Main from "./Main";
import registerServiceWorker from…

Sourabh Banka
- 1,080
- 3
- 24
- 48
1
vote
0 answers
How to integrate passport.js POST server-side login routes with react client-side navigation and routing?
I'd like to implement a redux action that triggers the passport.js authentication.
Passport's implementation is server-side and is POST route at /login on the express server.
I am using react starter kit with isomorphic…

MonkeyBonkey
- 46,433
- 78
- 254
- 460
1
vote
1 answer
React Router - dynamic routing setup
I am sure I am missing something simple here but can't get my routes configured properly.
I get this error:
Warning: Failed prop type: The prop 'children' is marked as required in 'App', but its value is 'undefined'.
in App (created by…

Moon
- 33,439
- 20
- 81
- 132
1
vote
1 answer
How to access value of a routing parameter in react?
I want to have a 'dynamic route' for a section of my app, which was done like this:
So far this works, but in Component I would like to access the value of id because it changes a bunch of things…

theJuls
- 6,788
- 14
- 73
- 160
1
vote
0 answers
History is not saving in the same component, with different route parameters, in React JS
I am working on a react js application for windows mobile. My route configuration is like below

Rajeshwar
- 2,290
- 4
- 31
- 41
1
vote
1 answer
React Redux routing - is there something simple that just works and isn't going to change in 12 hours?
Without hopefully having to go into all the options and issues, does anyone have or know of a solid routing solution that is simple and just works for a React Redux combination? If so can you please provide a complete working reference including…

D Durham
- 1,243
- 2
- 20
- 42
1
vote
1 answer
react-router v2.0 deep nested component passing in additional unexpected url
I have been trying to solve a problem I've facing the last few days with routing a deep nested component. I am using reactjs v14.6 and react-router v2.0 with browserHistory. If I swap it out for hashHistory and use the deprecated history mixin it…

Blah blah
- 394
- 2
- 15
0
votes
2 answers
ReactJS Routing
I have implemented routing in my React app and I wanted to redirect non-existent routes to errorpage.
Route:
{/* */}

Sunil Raj
- 43
- 4
0
votes
1 answer
How to pass state/data with useNavigate hook in react-location?
I have been trying to pass a state to the other page via route while using the useNavigate hook in the react-location. I looked all over the internet for it and couldn't find a solution. All the answers I found were for react-router, but I need it…

Sanjay Joshi
- 2,036
- 6
- 33
- 48
0
votes
1 answer
React app extending github repo name to the end of url (local and github pages)
I hope people are still using Stack overflow because I failed myself first and then ChatGPT failed me.
My problem is that I am trying to deploy this React app of mine to github pages and something weird is happening.
When I deploy the app, the url…

Mustafa_hd
- 129
- 1
- 7
0
votes
0 answers
While react routing it goes to the "*" route not the "/" route that i have defined
I want the home page to display instead of the error page on page load, without clicking the home page. I used / in exact to do so but it didn't work.
import React,{ useState } from "react";
import Navbar from "./components/Navbar";
import TextForm…

Ritwik Rudra
- 3
- 2
0
votes
0 answers
Passing a search query to a dynamically routed component with React
The App component uses the BrowserRouter library to render the Home component when the path = "/", the searchResults component is rendered when the path = "/seach:searchQuery". All this is functioning as expected.
The Home component itself renders…

MadeInUtrecht
- 69
- 1
- 9
0
votes
0 answers
Force initial React state when clicking the browsers history back button?
Is there a way to force the initial state on a page (in a component) when the page was reached via the browsers "history back" button ?
Simplest Example:
load this html file below
change the state
load a different website
click the browsers…

kca
- 4,856
- 1
- 20
- 41
0
votes
2 answers
What is the correct method to pass parameter to Laravel controller for filtering data?
This is my code of route for getting data from Laravel backend.
Route::get('/get/card',[CardController::class,'getCardList'])->name('card.list');
I call it like below,
http://127.0.0.1:8000/get/card
Controller code
public function getCardList()
{
…

Ruwan Liyanage
- 333
- 1
- 13