[英]react-router-bootstrap LinkContainer component fails with a TypeError (0 , _reactRouterDom.withRouter) is not a function
TypeError (0 , _reactRouterDom.withRouter) is not a function
TypeError (0 , _reactRouterDom.withRouter) 不是函数
I have my very simple react application in this codesandbox over here我有很简单的在这个反应应用codesandbox在这里
Help me debug this please.请帮我调试这个。
You have to options, either you downgrade your version (to v5.3.0) of react-router-dom so method withRouter will be available again (used by react-router-bootstrap) or you dismiss react-router-bootstrap and use the useNavigate Hook:您必须选择,要么将 react-router-dom 的版本降级(到 v5.3.0),以便 withRouter 方法将再次可用(由 react-router-bootstrap 使用),要么关闭 react-router-bootstrap 并使用 useNavigate钩:
const navigate = useNavigate();
...
<Nav.Link onClick={() => navigate('configuration')}>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.