Skip to content

Bug - Popper - Component crash when no children defined #9936

@nicolethoen

Description

@nicolethoen

The popper component is throwing an error (see screen grab and stack trace below)

Changing https://github.com/openshift/console/blob/0ed60b588f0be2090f3bec5a6a4c4e67eb8dc1ef[…]ents/dropdown/dropdown-with-switch/DropdownWithSwitchToggle.tsx to popper={<>{menu}</>} is a hack to workaround the issue.

In OCP's case, the Popper's popper prop is receiving a DropdownWithSwitchMenu component as a value which is of type React.FC<DropdownWithSwitchMenuProps>. This menu does not have a children prop, so the error is thrown, unless it's wrapped in a React fragment. Some sort of coercion of types is happening. Maybe the type of the popper prop needs to be tightened to prevent this run time error?

Screen.Recording.2023-12-18.at.3.02.32.PM.1.mov

Screenshot 2024-01-02 at 11 14 48 AM

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions