[Solution found!] 这是因为在该组件中未设置react-router上下文。由于它<Router>是设置上下文的组件,因此可以useHistory在子组件中使用,但不能在该子组件中使用。
確定! 回上一頁