Skip to content

support override antd submenu or antd popover components?Β #2998

Open
@hawx1993

Description

The problem

the antdv5.0 components popover and menu, or dropdown , it cannot directly override the style of the child component through styled.Menu, because the child component is inserted into the root node instead of existing as a child node of the parent node. A bit similar to the one created by the React.createProtal() method
so I have no idea how to override the subcomponent without glocalStyle.

we can't override submenu directly by :

 const StyledSubMenu = styled(SubMenu)``

because in antd v5.0, we can only use Menu components, there is no submenu component any more . refer =>
https://ant.design/components/menu

Additional context
antd submenu is created on the root of body ,rather than its parent node

image

I don't want to override by globalStyle, is there any good solutions?

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions