0 votes
in ReactJS by

How to pass params to history.push method in React Router v4?

1 Answer

0 votes
by

While navigating you can pass props to the history object:

this.props.history.push({
  pathname: '/template',
  search: '?name=sudheer',
  state: { detail: response.data }
})

The search property is used to pass query params in push() method.

Related questions

+1 vote
asked Mar 2, 2020 in ReactJS by RShastri
0 votes
asked Dec 8, 2020 in ReactJS by SakshiSharma
...