Questions tagged [react-router-component]
90 questions
0
votes
1 answer
Route inside Route - nesting routes - react.js
I have been looking for an answer to my question on github already, but nothing works for me..
My problem is that when I use Link in Reservation component it changes the path, but doesn't change change the visible component and the page become…
![](../../users/profiles/8696624.webp)
nightspite
- 81
- 1
- 8
0
votes
1 answer
In react Router i cant change the view but only the url is changing
Please tell me what's wrong in this when I am clicking on nav link the url is changing but the content is not changing
I am trying all the ways but can't figure out the problem, please have a look at this
App.js
import React, { Component } from…
![](../../users/profiles/12398988.webp)
Rohit doddapani
- 21
- 3
0
votes
0 answers
React Router active Class for home page
I've got a navigation that I am having a hard time trying to style. I have been able to add active classes to the navigational elements and apply styles to them, however the main dashboard which functions as a homepage does not get the dedicated…
![](../../users/profiles/5120544.webp)
Mike Manusama
- 89
- 2
- 10
0
votes
2 answers
React-router-dom: Clicking on Link adds the route to the Url Link indefinitely
After several attempts, I have managed to implement basic nested-routing with React-router-dom.
Here's the simple project structure:
Here are the relevant files:
App.js
import React from "react";
import logo from "./logo.svg";
import…
![](../../users/profiles/8965420.webp)
AG_HIHI
- 903
- 2
- 11
- 30
0
votes
1 answer
React-router-dom: Very simple nested routing does not work
I have searched through different tutorials and multiple stackOverflow questions. And none of which, helped me solve a very basic problem:
Implement nested routes with react-router-dom
Here's my code so far:
App.js
![](../../users/profiles/8965420.webp)
AG_HIHI
- 903
- 2
- 11
- 30
0
votes
1 answer
React-router-dom: Nested routes is not working but routes instead from within the root component App
I am following this tutorial to implement Nested routing.
Here's the relevant code:
App.js
…
![](../../users/profiles/8965420.webp)
AG_HIHI
- 903
- 2
- 11
- 30
0
votes
2 answers
Load react component in a different div than the one containing its link
I have a page with a header, footer and sidebar. The App.js file is as follows -
const App = () => {
return(
…
![](../../users/profiles/6090227.webp)
sindhugauri
- 169
- 11
0
votes
2 answers
Is it possible to abstract the Link declarations when using React-Router?
Consider the following:
import { Route, Link, Switch } from "react-router-dom";
import { Redirect } from 'react-router'
function Index() {
return
Home
; } function About() { returnAbout
; } function Users() { return…![](../../users/profiles/1315857.webp)
Antonio Pavicevac-Ortiz
- 4,898
- 8
- 40
- 94
0
votes
1 answer
Redirect to a page from a search form in React using React Router
Expected: On every page, I have a search form. When submitted, it will show the fetched data.
Occurs: When I submit the form, I receive a TypeError: dataItems is undefined
Here's my app component
class App extends Component {
render() {
…
![](../../users/profiles/10964617.webp)
Dave.Q
- 309
- 2
- 16
0
votes
0 answers
Mapped Component passed in React Router returns 'map' error
This is my file Structure
./src
./components
Tabnav.js
CharacterList.js
App.js
In my App.js file, I used Axios to fetch data from an Api, then I returned the 'CharacterList' component, passing it the properties gotten from the fetch results.…
![](../../users/profiles/5668183.webp)
Evans I.
- 1
- 3
0
votes
1 answer
How to pass context and props to component in Reactjs
This is my requirement.
When a route /xyz (displays xyz Component) is hit on browser, I need to navigate to separate route /abc (displays abc component).
I also need to pass new props and context to the target component on navigation.
I am looking…
![](../../users/profiles/12057818.webp)
Haritha
- 1
- 1
0
votes
1 answer
Hiding some navigation bar links in some of the react components: React+ React-Router+Typescript
I am a bit new to React.
I have a situation where I need to hide some navigation bar links in some components where as in the rest, I want to display them.
Actually been using react router V4 and typescript.
Need to hide page1 and page2 links when…
![](../../users/profiles/6927748.webp)
VJR08
- 5,503
- 5
- 21
- 48
0
votes
1 answer
Not getting props of Components in react-router
I want to use React Component to get id matches but it gives error when going to url : http://localhost:8080/portfolio/1 and run fine for other url. Error :
GET http://localhost:8080/portfolio/bundle.js 404 (Not Found) 1:1
Refused to execute…
![](../../users/profiles/9541893.webp)
Shiv Kumar
- 31
- 3
0
votes
0 answers
react router not rendering the view but url is changing
I have two tabs: Profile and Friends and the navlink are as follows
{tab.name}
where tab = [{
"name": "Profile",
"url": 'timeline'
},
{
…
![](../../users/profiles/7704420.webp)
Saurav Dutta
- 63
- 2
- 10
0
votes
1 answer
named path not working in react-router-dom react js
I am using react-router-dom for routing purposes. This is my code:
//Libraries
import React from 'react';
import { Tabs, Tab } from 'react-tabify';
import { connect } from 'react-redux';
import {
BrowserRouter as Router,
Route,
…
![](../../users/profiles/6396572.webp)
Beckham_Vinoth
- 633
- 13
- 32