Skip to content

Commit

Permalink
docs: add note that useId must be used with single root element
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Mar 17, 2024
1 parent 5b29dd3 commit 401370b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/3.api/2.composables/use-id.md
Expand Up @@ -19,11 +19,15 @@ const id = useId()
<template>
<div>
<label :for="id">Email</label>
<input :id="id" name="email" type="email"/>
<input :id="id" name="email" type="email" />
</div>
</template>
```

::note
`useId` must be used in a component with a single root element, as it uses this root element's attributes to pass the id from server to client.
::

## Parameters

`useId` does not take any parameters.
Expand Down

0 comments on commit 401370b

Please sign in to comment.