Answers for "pass state in history.push react"

5

passing data in react router history,push

this.props.history.push({
  pathname: '/template',
  search: '?query=abc',
  state: { detail: response.data }
})
Posted by: Guest on February-05-2021
4

history.push with params

import { useHistory } from "react-router-dom";

const FirstPage = props => {
    let history = useHistory();

    const someEventHandler = event => {
       history.push({
           pathname: '/secondpage',
           search: '?query=abc',
           state: { detail: 'some_value' }
       });
    };

};

export default FirstPage;
Posted by: Guest on August-26-2020
4

react router history push parameter

this.props.history.push({
  pathname: '/template',
  search: '?query=abc',
  state: { detail: response.data }
})
Posted by: Guest on March-17-2020
1

this.props.history.location.push

props.history.push({  pathname: '/register', state: data_you_need_to_pass});
Posted by: Guest on November-18-2020
2

passing data in react router history,push

this.props.location.state.detail
Posted by: Guest on February-05-2021
0

how to get state value from history react

history.push('/path', yourData);
Posted by: Guest on July-28-2020

Code answers related to "pass state in history.push react"

Code answers related to "Javascript"

Browse Popular Code Answers by Language