📜  如何在带参数的函数组件中使用历史推送? - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:57.636000             🧑  作者: Mango

代码示例3
function Button({ path, text }) {
  const history = useHistory();
  function handle(){
    history.push(path); // This should work now
  }
  return(
    
  );
}