因为。 window.history.back()
只会更改url in the url bar
并再次重新加载应用程序和所有资源,但不会重新加载rerender the correct UI component
,而来自react-router-dom
的路由器历史记录会设置网址并呈现correct React component
根据路线。
第二部分:
不能。由于安全原因 More,您无法检测到哪个外部网站用户来自您的应用。
在您自己的应用中,是的。您始终可以检测到用户是否通过window.onpopstate event
usage从应用程序的页面之一导航。