Questions tagged [react-routing]

70 questions
0
votes
0 answers

React history.push location.state is undefined on refresh

I am using history.push() to redirect to a page and passing some props like below: const ViewDetailCellRenderer = (props: any) => { let history = useHistory(); const scenario = props.data; const onButtonClick = (event: React.KeyboardEvent |…
Ap-Mich
  • 37
  • 9
0
votes
2 answers

React.js Render App.js after succesful Login

When an User succesfully is logged in through LoginForm.js LoginForm.js ----constructor, etc.---- }resetForm() { this.setState({ //bla bla }); }doLogin() { if (!this.state.email) { console.log("'Email' darf nicht leer…
0
votes
0 answers

Passing down Props to "Single Page Views" through components

Hey still new to React but I'm grinding my way through it slowly by building my own personal app/platform. I have a quick question of passing down props to single page views. This is my overview page that will pull in all the teams from my database…
Demonix
  • 43
  • 9
0
votes
1 answer

NextJS default routing but with namespace

I'm developing a site that has 2 variations. Current setup just re-routes but I don't want the site version to show up in the URL. url: localhost/site1/dashboard path: /pages/site1/dashboard url: localhost/site2/dashboard path:…
user391986
  • 29,536
  • 39
  • 126
  • 205
0
votes
0 answers

React router history pushes the uri but then doesn't load the correct page

Im working with React router. My app.js looks like the following -
0
votes
0 answers

React Routing (Redirect to Url) stopped working for already working code after performing npm link from a create-react-app

I am trying to publish a Npm Package called "React-Animated-FullScreen-SideNavBar" which has react-routing working for it out of the box. If you checkout the demo everything is setup and working beautifully so far. Demo link:-…
0
votes
0 answers

issue with Redirect To React Link

Below is my code of a functional component in react, where I am setting up the route based on the userLoggedIn status. let routes; if (user.loggedIn === true) { routes = (
0
votes
1 answer

Any way to render a dynamically added modal from api with routing in react?

working on a project for a hospital in which data on patients gets pulled from their api and gets loaded as cards on the page (will provide screenshots). When you click on a card more info of the patient gets pulled up as a modal. The goal here is…
0
votes
1 answer

How to redirect in react-router when routes are in different files

I was trying to redirect to the login page if the user is not logged in. It was working fine when I was using routes in App.js but after making seperate file for routing I am not. route.js import React from 'react'; import Login from…
Adesh Kumar
  • 952
  • 2
  • 16
  • 33
0
votes
1 answer

Images not showing up in routing / react build vs Dev

Im trying to get my images to appear in my build version of my react code. ```import reportIcon from "../../../../../src/img/reportmanager.svg"; ``` this code works when I am in build version. My…
wisert
  • 41
  • 6
0
votes
1 answer

React routing : URL gets changed but content from component didn't load

I am trying to implement react routing in basic react application. I have implemented it but somehow its not working properly. URL gets changed but content from component didnt load. Here is path for code :…
0
votes
1 answer

ReactJS change visibility of a button based on child component

I have project in ReactJS in that I have 3 types of different views to show data. For that I have 3 different component. I have one parent component in which I have one button called Rotate and three options two change view. My requirement is I need…
Mehul Patel
  • 1,084
  • 2
  • 12
  • 28
0
votes
2 answers

How to set the '/' as the default path in routing in reactjs?

I have publish the UI inside the api Service, but I want to start the url from '/'.But it is coming as the http://localhost:8090/UI/.the problem is that in route config I have set the routing as:- ReactDOM.render((
Gorakh Nath
  • 9,140
  • 15
  • 46
  • 68
0
votes
1 answer

Change tab content using router

I am making a react application. Can I change the "tab content area" on a button click using react-router. I have two tabs. I want to change content of one of the tab when I click a button. Everything else on the page should remain same but the…
EdG
  • 2,243
  • 6
  • 48
  • 103
0
votes
2 answers

how to define a react router's IndexRoute when using dynamic routing

What I have is a root route definition: const rootRoute = { childRoutes: [{ path: '/', component: require('./screens/Container'), appGlobalVars: appGlobalVars, childRoutes: [ …
Bertuz
  • 2,390
  • 3
  • 25
  • 50