1this.props.history.push({
2 pathname: '/template',
3 search: '?query=abc',
4 state: { detail: response.data }
5})
1function Button({ path, text }) {
2 const history = useHistory();
3 function handle(){
4 history.push(path); // This should work now
5 }
6 return(
7 <button onClick={handle}>
8 {text} // This should render now
9 </button>
10 );
11}
12
1function Button({ path, text }) {
2 const history = useHistory();
3 function handle(){
4 history.push(path); // This should work now
5 }
6 return(
7 <button onClick={handle}>
8 {text} // This should render now
9 </button>
10 );
11}
12