Skip to content

Commit 5d8767a

Browse files
Clarify useId example by removing placeholder code
1 parent 2da4f7f commit 5d8767a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/content/reference/react/useId.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,16 @@ import { useId } from 'react';
6767

6868
function PasswordField() {
6969
const passwordHintId = useId();
70-
// ...
70+
return (
71+
<>
72+
<input type="password" aria-describedby={passwordHintId} />
73+
<p id={passwordHintId}>
74+
The password should contain at least 18 characters
75+
</p>
76+
</>
77+
);
78+
}
79+
7180
```
7281
7382
You can then pass the <CodeStep step={1}>generated ID</CodeStep> to different attributes:

0 commit comments

Comments
 (0)