MCPcopy Index your code
hub / github.com/adobe/react-spectrum / Form

Function Form

packages/react-aria/test/utils/useFormReset.test.tsx:20–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18 it('should call onReset on reset', () => {
19 const onReset = jest.fn();
20 const Form = () => {
21 const ref = useRef<HTMLInputElement>(null);
22 useFormReset(ref, '', onReset);
23 return (
24 <form>
25 <input ref={ref} type="text" />
26 <button type="reset">Reset</button>
27 </form>
28 );
29 };
30 const {getByRole} = render(<Form />);
31 const button = getByRole('button');
32 fireEvent.click(button);

Callers

nothing calls this directly

Calls 1

useFormResetFunction · 0.90

Tested by

no test coverage detected