SAP UI5 Web Component React应用如何在Component之间跳转

3440阅读 0评论2020-02-10 i042416
分类:架构设计与优化

假设我要从React的home Component跳转到detail Component.


在home Component里,定义一个点击事件处理函数:

其实现源代码如下:

```JavaScript

 const history = useHistory();
  const handleProgressHeaderClick = () => {
    history.push("/detail");
  };

```

测试:点击Progress list后,注意观察url和显示区域的变化:

上一篇:React应用里Invalid hook call错误消息的处理
下一篇:SAP UI5 Web Component不同React页面的跳转实现