Autogenerate IDs to facilitate WAI-ARIA and server rendering. Optionally a user-provided string can be supplied to `useId` instead of auto-generating one.
npm install @react-lit/auto-idAutogenerate IDs to facilitate WAI-ARIA and server rendering.
Optionally a user-provided string can be supplied to useId instead of
auto-generating one.
``bash`
$ npm i @react-lit/auto-idor
$ yarn add @react-lit/auto-id
`js
import * as React from 'react';
import { useId } from "@react-lit/auto-id";
// This may be a single form field component.
function Example(props) {
const id = useId(props.id);
return (
<>
>
);
}
`
(1) Install dependencies
`bash`
$ npm ior
$ yarn
(2) Run initial validation
`bash`
$ ./Taskfile.sh validate
(3) Run tests in watch-mode to validate functionality.
`bash``
$ ./Taskfile test -w
---
_This project was set up by @jvdx/core_