Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Unknown prop separator on <div> tag. When I using Breadcrumb #4403

Closed
kunsam opened this issue Dec 29, 2016 · 6 comments
Closed

Warning: Unknown prop separator on <div> tag. When I using Breadcrumb #4403

kunsam opened this issue Dec 29, 2016 · 6 comments
Labels
help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request.

Comments

@kunsam
Copy link
Contributor

kunsam commented Dec 29, 2016

发生问题的环境是:

  • antd 版本: ^2.0.1
  • 操作系统及其版本: os X 10.11
  • 浏览器及其版本: Chrome Version 55.0.2883.95

others:
"react": "^15.4.1",
"react-addons-update": "^15.4.1",
"react-dom": "^15.4.1",

您做了什么?请提供尽可能详细的重现步骤。

引入 antd - Breadcrumb

{{
<Breadcrumb separator=">"> {...} </Breadcrumb>
}}

您期待的结果是:

我期望正确得到 “>” separator 分割的breadcrumb

如像官网一样的:
Home>Application Center>Application List>An Application

实际上的结果是:

react 报错
Warning: Unknown prop separator on

tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop ......

@kunsam kunsam closed this as completed Dec 29, 2016
@kunsam
Copy link
Contributor Author

kunsam commented Dec 29, 2016

我在
< Breadcrumb>{ condition? <Breadcrumb.item/> : <div />} </Breadcrumb>
中引入引入了
<div />
导致报错

@yesmeck
Copy link
Member

yesmeck commented Dec 29, 2016

Breadcrumb 只能嵌套 Breadcrumb.item。

试试: < Breadcrumb>{ condition && <Breadcrumb.item/>} </Breadcrumb>

@benjycui
Copy link
Contributor

Breadcrumb 也要引入类似 Select 之类的 warning。

@benjycui benjycui reopened this Dec 30, 2016
@benjycui benjycui added the help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request. label Dec 30, 2016
@benjycui
Copy link
Contributor

@kunsam 可有兴趣?

@kunsam
Copy link
Contributor Author

kunsam commented Dec 30, 2016

ok, 元旦do it

afc163 pushed a commit that referenced this issue Jan 14, 2017
* add warning when using Breadcrumb without its Item

fix issue ' Warning: Unknown prop `separator` on <div> tag. When I using Breadcrumb #4403'

ps: 我是个前端beginner, - ( ゜- ゜)つロ, 这是我第一个PR welcome, 如果写错或者还有更好的写法请大神指正。thanks

* remove compatible and use type as condition

按照 @benjycui 的意见去掉了兼容项,并使用type判断
@afc163 afc163 closed this as completed Jan 15, 2017
@lock
Copy link

lock bot commented May 2, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted The suggestion or request has been accepted, we need you to help us by sending a pull request.
Projects
None yet
Development

No branches or pull requests

4 participants