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…
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…
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…
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…
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
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
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(
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() { return

About

; } function Users() { return…
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() { …
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.…
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…
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…
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…
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' }, { …
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, …