Vue · Senior · Question 23 of 75

Why use useId() (3.5+) for id/aria-* attributes?

Explanation

A random or incrementing module counter produces different values on server and client. useId ties the ID to the component's position in the tree.

Further reading

Problem with a question

Vue · Senior · question 23

Test yourself

Take the Vue · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz