Skip to content

When should usePress be used, given that useButton exists? #3314

Answered by reidbarber
samselikoff asked this question in Q&A
Discussion options

You must be logged in to vote

Good question! It usually wouldn't be used by itself, but more likely would be used for handling press interaction within other ARIA patterns. For instance, a radio button requires press interaction, but doesn't have button semantics, so our useRadio hook uses it.

If you search the codebase for usePress, you'll see where it gets used within other hooks.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@snowystinger
Comment options

@samselikoff
Comment options

@reidbarber
Comment options

@snowystinger
Comment options

@samselikoff
Comment options

Answer selected by samselikoff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants