loader
pttman

pttman Muster

屬於你的大爆卦
pttman

pttman Muster

屬於你的大爆卦
pttman

pttman Muster

屬於你的大爆卦
  • Ptt 大爆卦
  • useHistory
  • 離開本站
你即將離開本站

並前往https://qastack.cn/programming/58220995/cannot-read-property-history-of-undefined-usehistory-hook-of-react-router-5

无法读取未定义的属性“ history”(React Router 5的useHistory ...

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

確定! 回上一頁

查詢 「useHistory」的人也找了:

  1. usehistory用法
  2. react-router-dom
  3. React history
  4. useparams用法
  5. React location
  6. useHistory undefined
  7. uselocation用法
  8. React Router

關於我們

pttman

pttman Muster

屬於你的大爆卦

聯終我們

聯盟網站

熱搜事件簿