How to use history push within function component with parameters?
functionButton({ path, text }){const history =useHistory();functionhandle(){
history.push(path);// This should work now}return(<button onClick={handle}>{text}// This should render now</button>);}
How to use history push within function component with parameters?
functionButton({ path, text }){const history =useHistory();functionhandle(){
history.push(path);// This should work now}return(<button onClick={handle}>{text}// This should render now</button>);}