InterviewHubPRO
Section Overview
Q85

Question 85 of 445

Part 2: React Router & Navigation (78 - 88)

19%
React & Modern Frontend (445 Qs)•Part 2: React Router & Navigation (78 - 88)

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

While navigating you can pass props to the history object:

javascript
this.props.history.push({
pathname: "/template",
search: "?name=alex",
state: { detail: response.data },
});

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