首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >警告: validateDOMNesting(…):<a>不能作为<a>的后代出现

警告: validateDOMNesting(…):<a>不能作为<a>的后代出现
EN

Stack Overflow用户
提问于 2019-04-11 13:40:47
回答 3查看 44.4K关注 0票数 28

我正在尝试在创建-重新应用程序.In中将react-router与reactstrap一起使用我需要为reactstrap使用状态的路由页面,因此我将路由器从变量转换为类。我收到以下警告:警告: validateDOMNesting(...):

我不知道该怎么做,我需要用reactstrap设置路由器导航的样式,所以我按照你下面看到的做了。

有很多原因导致这个方法不起作用:

代码语言:javascript
运行
复制
anywords
代码语言:javascript
运行
复制
(a bunch of li not relevant)

          
            
            
                anywords
              
(then just more of the above)


other than a couple of li coming close to each other at random times and me having to refresh the page sometimes instead of the normal behaviour (auto refresh ) and the warning message i get in the console ,nothin bad happens but when i read about this issue i found out that i shouldn't do it.
EN

Stack Overflow用户

发布于 2019-09-15 09:23:38

添加

将属性(以前称为componentClass)添加到原始NavLink以保持样式不变,同时使警告保持静音。

https://react-bootstrap.netlify.com/components/navs/#nav-link-props

或者

查看屏幕截图

原件:

新增:

票数 16
EN
查看全部 3 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55625431

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档