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: BreadcrumbItem is required as the wrapper of children element #4651

Closed
jaysson opened this issue Jan 19, 2017 · 7 comments
Closed

Comments

@jaysson
Copy link

jaysson commented Jan 19, 2017

Environment(required)

  • antd version: 2.6.3
  • OS and its version: MacOS Sierra
  • Browser and its version: Google Chrome

What did you do? Please provide steps to re-produce your problem.

Copy pasted following code into a react component:

import { Menu, Icon, Breadcrumb, Layout } from 'antd';
<Content style={{ padding: '0 50px' }}>
          <Breadcrumb>
            <Breadcrumb.Item>Home</Breadcrumb.Item>
            <Breadcrumb.Item><a href="">Application Center</a></Breadcrumb.Item>
            <Breadcrumb.Item><a href="">Application List</a></Breadcrumb.Item>
            <Breadcrumb.Item>An Application</Breadcrumb.Item>
          </Breadcrumb>
          <div style={{ background: '#fff', padding: 24, minHeight: 280 }}>{ children }</div>
        </Content>

What do you expected?

It would work fine as it is taken from official website

What happened?

It renders properly, but I see the following error in console

Warning: BreadcrumbItem is required as the wrapper of children element

@yesmeck
Copy link
Member

yesmeck commented Jan 19, 2017

Are you using react-hot-loader 3?

@afc163
Copy link
Member

afc163 commented Jan 19, 2017

Maybe we should use a static property xxx.__name? @yesmeck

@yesmeck
Copy link
Member

yesmeck commented Jan 19, 2017

How about this?

class BreadcrumbItem extends React.Component {
  ...
}

BreadcrumbItem.__antBreadcrumbItem = true;

// use 
if (elment.type.__antBreadcrumbItem) {
    ...
}

@yesmeck
Copy link
Member

yesmeck commented Jan 19, 2017

@jaysson
Copy link
Author

jaysson commented Jan 19, 2017

Yes, I am using react-hot-loader 3.

@yesmeck
Copy link
Member

yesmeck commented Jan 19, 2017

Traced in #4655.

@yesmeck yesmeck closed this as completed Jan 19, 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
None yet
Projects
None yet
Development

No branches or pull requests

3 participants