ICode9

精准搜索请尝试: 精确搜索
  • useHref() may be used only in the context of a <Router> component2022-07-08 18:02:58

    "react-router-dom": "^6.3.0".使用Link组件时提示报错,useHref()只能在Router组件中使用。     解决办法:在index.tsx文件使用Router组件包裹App组件,同时删除router.js路由注册文件中的Router包裹组件,使得所有组件处在同一个Router组件之下 <React.StrictMode> <HashRouter

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有