MCPcopy Create free account
hub / github.com/react-hook-form/react-hook-form / App

Function App

examples/V6/forwardRefToPassRefProp.tsx:8–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6});
7
8export default function App() {
9 const { register, handleSubmit } = useForm();
10 const onSubmit = (data, event) => {
11 console.log(data);
12 };
13
14 return (
15 <form onSubmit={handleSubmit(onSubmit)}>
16 <Input ref={register} name="firstName" />
17 <Input ref={register} name="lastName" />
18
19 <button>Submit</button>
20 </form>
21 );
22}

Callers

nothing calls this directly

Calls 2

useFormFunction · 0.85
handleSubmitFunction · 0.85

Tested by

no test coverage detected