我有一个带有品牌的导航栏,我希望该品牌成为主页的链接。
import { NavLink } from "react-router-dom";
.
.
.
<Navbar color="white" light expand="sm" className="py-0">
<NavLink to="/">
<NavbarBrand>
<img src={ logo } />
</NavbarBrand>
</NavLink >
</Navbar>
这会导致警告:
Warning: validateDOMNesting(...): <a> cannot appear as a descendant of <a>.
in a (created by NavbarBrand)
in NavbarBrand (at NavBar.js:53)
in a (created by Link)
in Link (created by Route)
in Route (created by NavLink)
那我该如何继续使用 reactstrap 和 react-router 呢?