react-bootstrap:关于未知道具的警告 [英] react-bootstrap: Warnings about unknown props
问题描述
我不知道为什么,但我注意到浏览器控制台中有很多关于未知道具的警告.以下是一些警告:
I'm not sure why but I am noticing a lot of warnings in my browser console regarding unknown props. Following are some of the warnings:
"Warning: Unknown prop `navbar` on <ul> tag. Remove this prop from the element. For details, see
in ul (created by Nav)
in Nav (created by NavbarWrapper)
in div (created by NavbarWrapper)"
"Warning: Unknown prop `divider` on <a> tag. Remove this prop from the element. For details, see
in a (created by SafeAnchor)
in SafeAnchor (created by MenuItem)
in li (created by MenuItem)
in MenuItem (created by NavbarWrapper)
in ul (created by DropdownMenu)
in DropdownMenu (created by Dropdown)
in li (created by Dropdown)
in Dropdown (created by Uncontrolled(Dropdown))
in Uncontrolled(Dropdown) (created by NavDropdown)
in NavDropdown (created by NavbarWrapper)
in ul (created by Nav)
in Nav (created by NavbarWrapper)"
NavbarWrapper 是我编写的一个 react 组件,用于呈现 react-bootstrap 导航栏.
NavbarWrapper is a react component that I wrote which renders a react-bootstrap navbar.
我直到今天(2016 年 7 月 4 日)才开始注意到这些警告.但是,导航栏按预期工作.
I only started noticing these warnings as of today (July 4, 2016). However, the navbar is working as expected.
我使用的是meteor 1.3.4.1,react 15.1.0,react-bootstrap 0.29.5
I am using meteor 1.3.4.1, react 15.1.0, and react-bootstrap 0.29.5
如果我做错了什么,请有人告诉我吗?
Can please somebody let me know if I am doing something wrong?
推荐答案
不是真正的答案(新用户,还不能发表评论)但似乎react 最近升级到版本 0.15.2 并且部分更改发出警告,将未知元素(或道具)传递给 dom.
Not really an answer(new user, can't comment yet) but it seems that react recently upgraded to version 0.15.2 and part of the changes was giving off a warning for passing a unknown elements(or props) to dom.
这不会破坏您的用户界面,但会在您的浏览器控制台中包含烦人的警告日志.
This won't break your UI but would include annoying warning logs to your browser console.
其他相关链接:https://github.com/react-bootstrap/react-bootstrap/issues/1970
这篇关于react-bootstrap:关于未知道具的警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!