Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 401370b

Browse files
committed
docs: add note that useId must be used with single root element
1 parent 5b29dd3 commit 401370b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/3.api/2.composables/use-id.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ const id = useId()
1919
<template>
2020
<div>
2121
<label :for="id">Email</label>
22-
<input :id="id" name="email" type="email"/>
22+
<input :id="id" name="email" type="email" />
2323
</div>
2424
</template>
2525
```
2626

27+
::note
28+
`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.
29+
::
30+
2731
## Parameters
2832

2933
`useId` does not take any parameters.

0 commit comments

Comments
 (0)