Skip to content

Layout warns when wrapping Panel/NavDrawer/Sidebar in custom component #641

Closed
@InfernoZeus

Description

@InfernoZeus

I'm trying to wrap the NavDrawer in a custom component which accepts a list of menu items. When doing this, Layout warns that it only accepts Panel as a child, with optional NavDrawer and Sidebar:

Warning: Failed prop type: Layout should have a Panel for a child, optionally preceded by a NavDrawer and/or followed by a Sidebar.
in Layout (created by Themed Layout)
in Themed Layout (created by App)
in div (created by App)
in App (created by RouterContext)
in RouterContext (created by Router)
in Router

My layout has a NavMenu component, which is causing the issue:

...
<Layout>
  <NavMenu items={menuItems}></NavMenu>
...
class NavMenu extends React.Component {
  render () {
    return <NavDrawer ...>{generatedMenuItems}</NavDrawer>;
  }
}

Is this likely to cause issues? If not, is there be some way to disable the warning?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions