Category "react-router-dom"

React-router HashRouter When redirecting root URL with query parameters, route gets appended after params

I'm having the following issue. I am implementing SSO which, after successful sign in, redirects the user to the root uri with the access_token as a query param

Imported components transformed into "/static" urls in react-create-app

I'm having an issue I can't really find any previous answers to or documentation about. I'm loading a component, in a module, on my local machine, "login.jsx,"

React-Router-dom and useHistory. Pushes new URL to history and changes URL but page does not change [duplicate]

I am to create an app which utilizes react-router-dom. I am currently trying to us eversion 5.2.0. I have tried to isolate the issue and focus

React link's onClick event state change is not happening

I have used react links with mui and I am trying to highlight the active link in header. My attempt is as below. import Link from "@mui/material/Link"; import {

React Router target div id in home page

I am using react router specifically the HashRouter since I am trying to host my react app on github pages. Prior to using the HashRouter I was just using the B

How to protect reactjs resources with spring boot based authentiation?

My current project state: I am working on a Web Application with ReactJs (frontend) and spring boot (backend). When I deploy this application, I package react

How to protect reactjs resources with spring boot based authentiation?

My current project state: I am working on a Web Application with ReactJs (frontend) and spring boot (backend). When I deploy this application, I package react

React-router-dom Prompt: Iframe within a page gets unloaded/loaded [closed]

I am working on a react spa to show alert on unsaved form changes. I am using [email protected] Prompt Component for this use-case. The p

./src/App.js Attempted import error: 'Switch' is not exported from 'react-router-dom'

I can't figure it out why doesn't work. I have uninstalled the react-router-dom package and reinstalled it, but I always have the same error. The error I'm gett

Alternative for Prompt in React Router V6

What is the alternative for Prompt in React Router V6, has it been deprecated, and also hooks like usePrompt, useBlocker are also not available. <Prompt mess

ReactJS: [Home] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>

I am trying to navigate to "/quiz" when Start Quiz button is clicked. However when I compile my code I am getting the following error on the website applicatio

Config route in react-router-dom v6

I am using react-router-dom with typescript. I create a config file like below: export interface RouteComponent { path?: string; element?: React.ComponentTy

React Router Dom v6 - Functions are not valid as a React child

Im trying to upgrade to v6 of react router dom. The application works but I cant seem to get the testcases to work. Before we had this wrapper for jest: const r

Error "Error: A <Route> is only ever to be used as the child of <Routes> element"

I am trying to use routing for the first time and followed the exact instructions from Udemy: File App.js: import { Route } from "react-router-dom"; import Welc

MUI Nav Tabs does not work with react-router

Here are the four components: App.js: import React from 'react'; import { Route, Switch } from 'react-router-dom'; import About from './About'; import Home from

How to get data from prop.location.state in react?

I try to send data through history push like that. And then I try to get the value of id that I send. The problem is when the first time rendering of compon

React Link doesn't refresh the page

I have this code: <Link to="/dashboard" style={{ color: '#A4A4A4' }}>Dashboard</Link> As part of my app, but if i'm currently viewing the /dashboa

React Router: How to stop redirecting until API returns a response?

I have a login page but that authenticates the login on router with a call to the backend. The backend returns a response 200 if the user is authenticated, and

React Router not working with Github Pages

If you go on my site, https://amodhakal.github.io/portfolio/, then you would realize that that the site is only showing the navbar, not the home page. It only s

react route component is not rendering anything

I created my app with create-react-app and tried to use react-router on it. but it's not working at all. I am using react-router-dom 5.3.0 version. But if I typ