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

Function FrameForm

app/src/crossFrameForm.tsx:44–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42};
43
44const FrameForm: React.FC = () => {
45 const { register, watch } = useForm();
46
47 const value = watch();
48
49 return (
50 <>
51 <form>
52 <label>
53 Free text
54 <input type="text" {...register('input', { required: true })} />
55 </label>
56
57 <label>
58 <input
59 type="radio"
60 value="a"
61 {...register('radio', { required: true })}
62 />
63 Choice A
64 </label>
65
66 <label>
67 <input
68 type="radio"
69 value="b"
70 {...register('radio', { required: true })}
71 />
72 Choice B
73 </label>
74 </form>
75
76 <label>
77 Form value
78 <pre>{JSON.stringify(value)}</pre>
79 </label>
80 </>
81 );
82};
83
84export default CrossFrameForm;

Callers

nothing calls this directly

Calls 3

useFormFunction · 0.85
watchFunction · 0.85
registerFunction · 0.85

Tested by

no test coverage detected