question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning: `BreadcrumbItem` is required as the wrapper of children element

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
yesmeckcommented, Jan 19, 2017

How about this?

class BreadcrumbItem extends React.Component {
  ...
}

BreadcrumbItem.__antBreadcrumbItem = true;

// use 
if (elment.type.__antBreadcrumbItem) {
    ...
}
0reactions
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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invariant Violation: Objects are not valid as a React child
I was having this error and it turned out to be that I was unintentionally including an Object in my JSX code that...
Read more >
ra-navigation documentation | React-Admin Enterprise Edition
To expose the app location to all react-admin components, wrap the <Layout> ... It's the job of its children ( <BreadcrumbItem> elements) to...
Read more >
Breadcrumbs - Fictoan
The Breadcrumbs uses a native nav and li elements. ... The entire markup is wrapped in the BreadcrumbsWrapper , with individual BreadcrumbItem children...
Read more >
KendoReact Changelog - Telerik
wrap .k-tooltip element in .k-child-animation-container container ... grid in v5 requires buttons, but was not state in the package.json ...
Read more >
Why to get "Router may have only one child element" warning
We, first import the required tags from the react-router-dom dependency. Note that it is written BrowserRouter as Router.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found