The way you are passing your state to the
Redirect is correct, the only place the problem should be is how you are accessing it. State can be accessed like
this.props.location.state. However if you directly route to the
path then state won't we available so you need to add a check
Access your state like
this.props.location.state && this.props.location.state.referrer
- How can I pass data using <Redirect> in react router v4?
- How do you pass data when using the navigate function in react router v6
- How to pass data from a page to another page using react router
- I can not get the state from react router Link component using useLocation. So how can I pass it?
- How can i redirect to a component in react redux after returning promise (axios) . I am using react router 4
- How can I pass Apollo data and React Router 4 url params to my components
- How can I pass function using props in React Router Link?
- How can I pass props from one component to another using Link and router in react
- How can I pass data to an object using React Hooks and Redux
- How can I pass my Todo component Data into my Todolist component using React hooks?
- How to pass params into link using React router v6?
- using css modules in react how can I pass a className as a prop to a component
- How to pass the match when using render in Route component from react router (v4)
- How can I pass data from express server to react views?
- how to pass props to the route when using react router <Link>
- How can I cache data that I already requested and access it from the store using React and Redux Toolkit
- How we can convert client side rendering react js app to server side rendering using react router 4?
- How can I use previous location to redirect user in react router v6?
- How to refer to data with permalinks using react router
- How can i pass parameters on redirection using react router?
- How to redirect to not found page if slug doesn't exist using React Router Dom?
- How can I get data from query string using route in react js
- How can I redirect to auth0 without clicking on the Log In button in react using the new auth0-spa.js?
- How to pass props using react router link v6?
- How to redirect to homepage using React Router and React Query
- How can I redirect to another component in react and pass the state that I set in the previous component?
- How to pass data from blade.php file to a react component using HTML element attributes?
- How can I get the data out of a table using Semantic UI React
- How can I pass a function as a prop to a React component using react-router <Redirect />?
- How can I pass event properties to a customEvent using React Testing Library?
More Query from same tag
- How to convert blob url into mp3 audio in django
- react useCallback not updating function
- Mapping object to child component in React
- How to define possibly undefined type
- Unable to Install React-Intl using NPM
- Converting React Class based to Function based component
- Linking to a different page using react-day-picker and react router v4
- React - Keep form information after getting a 401 response from API
- How to display a flexible grid in React
- Jest babel - Spread Operator - Jest encountered an unexpected token
- How to add onClick to the map `leaflet`
- React Storybook: Trying to set specific actions to different Templates
- React and stateless components
- Receiving same message multiple times via web socket. The older messages are replaced after 3 or 4 new chat messages
- New RxJS subscription gets created during page hot module replacement
- React-select value set to null on first selection
- In a controlled React number input, how can you trim leading zeros?
- React Unexpected token with babel-loader
- How to map through data that contains empty values
- How to fix the error 'alpha' is not exported from '@material-ui/core/styles' when using Skeleton in Material UI
- cannot read property of undefined using default value
- Save data in a special order when click on button
- React Todo list. form input not dissapearing after onsumbit
- How to toggle from another js file in React.js
- I am trying to create a react app using the "npx/npm create-react-app hello" command and got this whole message
- Invalid value for createPaymentMethod: card should be an object or element
- Firebase Auth for Twitter with React
- React.js: Composing components to create tabs
- Validating variables in the state used in render() to style/populate html
- How to dynamically display moment date in React