Sha256: 7feb20d1f8fbb487d1e0821e6b77a1bc64d0ca9e96394944e26b7f0c911f1d8a
Contents?: true
Size: 613 Bytes
Versions: 1573
Compression:
Stored size: 613 Bytes
Contents
To access the kit's input element attributes or add event listeners, create a `ref` inside your parent component, pass it to the kit's `ref` prop, and use `ref.current.inputNode()` with your desired attribute or event listener inside a `useEffect` hook. `useEffect` is necessary because the `ref` will be initially `undefined`. Calling `useEffect` with an empty dependency array ensures your event listeners won't be added twice. `inputNode()` is a custom function inside the kit that returns the input DOM element and its attributes. For example, to get the `name` attribute, use `ref.current.inputNode().name`
Version data entries
1,573 entries across 1,573 versions & 2 rubygems