nandorojo / zeego

Menus for React (Native) done right.
https://zeego.dev
MIT License
1.45k stars 42 forks source link

Should we implement the `Sub` component? #16

Closed nandorojo closed 1 year ago

nandorojo commented 1 year ago

It looks like Radix changed their way of making sub-menus.

Previously, to make a submenu, you would add a DropdownMenu.Root inside of an existing one. However, they now seem to use a Sub, SubTrigger, and SubContent as seen here.

I can see their reasoning here. The new API is much clearer. It's just a bit annoying to have to maintain parity, but it's probably the right move.

This is a breaking change from Radix v1, so chances are, I have to build these features before releasing zeego v1.

If anyone wants to submit a PR for these, it would be awesome. It would require:

  1. installing direct dependencies of Radix UI's dropdown/context menus into zeego
  2. adding Web/iOS/Android files for each Sub* element. Web will be easy; the others require understanding how Zeego maps children mostly.
nandorojo commented 1 year ago

They also added a Portal outside of Content 🫣

nandorojo commented 1 year ago

Looks like portal isn't needed, so I'll leave that out: https://codesandbox.io/s/y26ob7?module=App.js&file=/App.js:2339-2343