Skip to content

Should react-aria hooks expose data attributes in props? #5632

Answered by snowystinger
Gomah asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, thanks for the discussion. We have soft decided not to include the data-attributes because it would be more opinionated and the hooks are meant to be general.

We do recognize that it might make the "dropping down" to the hooks, from RAC specifically, a bit easier, but figured we'd hold off in the initial release to see how common it is in practice.

The right approach right now would be to add the appropriate hooks and create the data-attributes yourself. You can look at the source or docs for a given RAC component in order to see which ones should be applied as well as how we apply it ourselves.

This approach also allows people to more easily customize the name of the data-* attribut…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Gomah
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants