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

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

Closed
nicolethoen opened this issue Jan 5, 2024 · 0 comments · Fixed by #10086
Closed

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

nicolethoen opened this issue Jan 5, 2024 · 0 comments · Fixed by #10086
Assignees
Milestone

Comments

@nicolethoen
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants