Questions tagged [react-router-v4]

React Router - A complete routing library for React inspired by Ember's routing system

Introduction

React Router is a powerful routing library built on top of React that helps you add new screens and flows to your application incredibly quickly, all while keeping the URL in sync with what's being displayed on the page.


Docs


Related tags

1983 questions
0
votes
2 answers

React Router v4 Multiple Dynamic Routes

I'm new to React Router so if this has been asked before maybe someone could point me in the right direction! Basically I have a WordPress install that I'm pulling in my websites data from through the API. I've created custom routes to query my…
WordPressFreddie
  • 129
  • 2
  • 12
0
votes
0 answers

plain react router v4

It's possible create plain routes in react-router v4? Ex (v3 version): const routes = { path: '/', indexRoute: {onEnter: (nextState, replace) => replace('/calendar')}, childRoutes: [ {path: '/calendar', component: CalendarContainer}, …
Daxik
  • 123
  • 8
0
votes
2 answers

Routing issue with reactjs router 4 and redux

Hello I' m building a project where I have used reactjs redux and react-router-dom. For some strange reason that I can't figure out, when I navigate to http://localhost:3000 I get the following error: Warning: You tried to redirect to the same route…
syd619
  • 2,952
  • 4
  • 39
  • 75
0
votes
0 answers

ReactJS route shows empty page

Using ReactJS frontend, with react-router, I somehow get an empty page when being redirected to a new route. In a component I use the following to achieve a redirect: if (this.props.showUnknownErrorPage) { return
Rik Schoonbeek
  • 2,501
  • 1
  • 15
  • 30
0
votes
4 answers

How does React-Router-4 check for additional (unnecessary) slashes "/" typed in manually?

There's a potential bug I found in react router. In my component, I do this: if(this.props.location.pathname === "/home") to check whether the user is at a path. It can be buggy, because the above condition is false if the user enters the URL…
Alisa T Morgan
  • 527
  • 1
  • 5
  • 12
0
votes
1 answer

React router - redirect all routes except one

I'm trying to implement protected routes in React. Following is my implementation if (isAuth()) { routesToRender = ( {/* */}
Sooraj
  • 6,517
  • 4
  • 51
  • 87
0
votes
1 answer

pass parameters to route without the url in react-router-dom

im trying to render something like whatsapp, in the main screen you got all the groups rendered, and when you click on a group then a new route become active and the main screen disabled, i want that when the user click on the group (its a object…
0
votes
1 answer

React router: new component only render on existing view

I am trying to switch between two pages, but ran into many problems whiling learning react router Within my App.js, there is a bottom, which will navigate me to Cart when clicked. render() { return (
0
votes
2 answers

How to show default component always in react router

I want to show the header page always in every route.How to do this. I want props.history to be accessible inside that header component so that if i click any thing i can navigate to other page using props.history.push();
Trinu
  • 1,133
  • 3
  • 12
  • 34
0
votes
1 answer

React router, How to render component within a layout (vs. stand alone)

I have my meteor app working with React and React-Router. I am able to set up routes and render them correctly. My issue is I would like to render a component inside a layout (common grid, menu, header, etc). Right now, any path renders the…
ppedrazzi
  • 703
  • 2
  • 9
  • 18
0
votes
0 answers

react-router: Not render component after url updater

I use "react": "^16.5.0", "react-router": "^4.3.1", "react-router-dom": "^4.3.1", Has router import * as React from 'react'; import { Route, Switch } from 'react-router-dom'; import GoToNode from './components/map/GoToNode'; const Router = (props)…
podeig
  • 2,394
  • 6
  • 31
  • 53
0
votes
1 answer

Handle a Route that can match an exact path or a path with parameter with react-router

I work with react-router v4, and I like to merge different route to a single one. Is there a way to simplify the following code:
tzi
  • 6,629
  • 1
  • 20
  • 40
0
votes
1 answer

React Router Native(4.3.0) Url Params break app

I've got a React Native project which I'm using react-router-native version 4.3.0.
0
votes
1 answer

Letting some routes be handled by Groovy and some by react-router v4

The code that I'm working with has controllers in the backend Groovy code which render GSP (Groovy Server Pages). And for the frontend we're using react-router v4 to handle routes. The problem I'm encountering is that by defining a route in…
ScaVenGerS
  • 61
  • 10
0
votes
0 answers

React + Express routing issue

I have one react application created using create-react-app command. For example I have the following routing in my react application. /Home /About /Profile/:id Each routing is working perfectly in create-react-app. In my node application I have…
1 2 3
99
100