Migration from DeprecatedMenu/Menu in preview-react to Menu in main #2063
josh-bagwell
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This will be a migration guide to help the migration from the
DeprecatedMenu/Menucomponent that is a part of thepreview-reactto theMenucompound component that is inmain. Please see theMenudocumentationhere.
If you would like to see the differences between
DeprecatedMenuand theMenucompound component,see this codesandbox example.
See below for how these components will migrate:
<DeprecatedMenu/> -> <Menu/>(This will be the parent container that wraps those)
<DeprecatedMenuItem/> -> <Menu.Item/><Popup/>Not needed to wrap
<Popup.Popper/> -> <Menu.Popper/>The "Popper" of a menu. The popper will appear around the
Menu.Target. It renders adivelement that is portalled to thedocument.bodywhich is controlled by thePopupStack. ThePopupStackis not part of React. This means no extra props given to this component will be forwarded to thedivelement, but therefwill be forwarded.<Popup.Target/> -> <Menu.Target/>hasDivider -> <Menu.Divider/>This will need to be moved from a prop to a sub-component. This is a divider for the
<Menu.Card/>The menu card is a non-semantic element used to give the dropdown menu its distinct visual cue that the dropdown menu is floating above other content. A menu card usually contains a menu list, but can also contain other elements like a header or footer.
<Menu.List/>The menu list follows the Collections API. A list can either contain static items or a render prop and
itemsto the model.Below are some basic examples of
DeprecatedMenuand theMenucomponent frommain.DeprecatedMenuandDeprecatedMenuItem:Menu:Beta Was this translation helpful? Give feedback.
All reactions