Category "react-router"

How to intercept back button in a React SPA using function components and React Router v5

I'm working in a SPA in React that doesn't use React Router to create any Routes; I don't need to allow users to navigate to specific pages. (Think multi-page q

How to handle React Router with Node Express routing

I am trying to manage a react app with react router and node js server my router in react: <BrowserRouter> <Switch> <PrivateRoute tok

React-router - How to pass data between pages in React?

I am working on a project where I have to pass data from one page to another. For example, I have data on the first page. let data = [ {id:1, name:'Ford', co

Error: useLocation() may be used only in the context of a <Router> component

I have installed react-router-domV6-beta. By following the example from a website I am able to use the new option useRoutes I have setup page routes and returni

./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

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

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

Why does my React Router return blank pages?

I am using the latest version of create-react-app. I have searched all tutorials and tried a few websites with different tutorials but I am not getting errors.

React/Redux Testing - Could not find "store" in either the context or props

I'm new to react/redux and just getting into testing my first app with chai. I'm using redux-form/immutable and react-router, and I'm not sure how to resolve th

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

Using multiple layouts for react-router components

If I have the following: <Route path="/" component={Containers.App}> { /* Routes that use layout 1 */ } <IndexRoute component={Containers.Home}/&

Using multiple layouts for react-router components

If I have the following: <Route path="/" component={Containers.App}> { /* Routes that use layout 1 */ } <IndexRoute component={Containers.Home}/&

React App url parameter with S3 and CloudFront

My apologies if the information that I have provided is vague as I am not so experience with AWS and React. I have a React Application being deployed on S3 and

A component suspended while responding to synchronous input

error Error: A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that s

React router, redux, electron: router isn't rendering

I'm trying to get react-router to work in an electron app. I'm using a boilerplate and stripped away some of the stuff I don't want but that should provide a pr

Passing props to dynamically rendered components in React

I have a page that is displaying several of my star components that each have their own name and a prop called starType I am generating several different of the

React Native Context rendering a blank screen when wrapped inside <Provider>

I'm trying to build a simple blog native app using context and have stumbled upon an issue to which I can't find a root to. Here's the structure of it: /context

React Routing vs Express Routing

Been watching alot of tutorials and i see that there is express routing as well as react routing. Is the react routing for client and the node js routing for