1import { useHistory } from "react-router-dom";
2
3const FirstPage = props => {
4 let history = useHistory();
5
6 const someEventHandler = event => {
7 history.push({
8 pathname: '/secondpage',
9 search: '?query=abc',
10 state: { detail: 'some_value' }
11 });
12 };
13
14};
15
16export default FirstPage;
17
18
1this.props.history.push({
2 pathname: '/template',
3 search: '?query=abc',
4 state: { detail: response.data }
5})
1<Link to={{ pathname: "/register", state: data_you_need_to_pass }}> Register</Link>