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

Add support for new element types to be used as menu items #174

Open
corymharper opened this issue Jul 17, 2020 · 3 comments
Open

Add support for new element types to be used as menu items #174

corymharper opened this issue Jul 17, 2020 · 3 comments

Comments

@corymharper
Copy link
Member

Currently only HTMLAnchorElements are supported for use as menu item elements with the hook. For flexibility, and as not to prescribe the implementation of the hook to developers using the package, making the ref's typing more generic but still type safe would be a warranted enhancement.

This will probably require an addition of passing generic types to the hook in order to accomplish.

@WesCossick
Copy link
Member

Similar to #69.

@msakrejda
Copy link
Contributor

👍, a good use case for this is handling elements like react-router's Link that wrap anchor tags.

@msakrejda
Copy link
Contributor

msakrejda commented Feb 21, 2022

Actually, because Link just renders an anchor, that's mostly moot here. But here's a different use case: menu items could be used to trigger form submission (e.g., see the log out action in this Remix example: https://remix.run/docs/en/v1/tutorials/jokes#build-logout-action -- you'll need to expand jokes.tsx).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants