Skip to content

Make React.Children maps null-safe #523

@greg-a-smith

Description

@greg-a-smith

Description

As was found in #517, the following syntax:

    {condition && <Component />}

will pass null in the children array when the condition is false. It's unfortunate that it just simply isn't omitted (as the syntax would seem to indicate), but that's how it works. #517 is addressing TabGroup, but there are other components that should have similar protection added to be safe against null children. At a minimum, it looks like:

  • FormRadioGroup
  • SideNav
  • SideNavList
  • SideNavListItem
  • BaseTree
  • TreeHead
  • TreeItem
  • TreeRow
  • TreeView

Those components are using React.Children, but there may be others doing a map on children a different way.

Versions

fundamental-react: 0.5.1
fiori-fundamentals: n/a

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