MCPcopy Index your code
hub / github.com/react-hook-form/react-hook-form / appendQuestion

Function appendQuestion

examples/V6/fieldArrayMinLength.tsx:36–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34
35 const isInitialRender = React.useRef(true);
36 const appendQuestion = () => {
37 append({
38 text: '',
39 });
40
41 if (errors.questions?.type === 'min') {
42 clearErrors('questions'); // always clear errors when there is add action.
43 }
44 };
45
46 React.useEffect(() => {
47 if (!fields.length && !isInitialRender.current) {

Callers

nothing calls this directly

Calls 2

appendFunction · 0.85
clearErrorsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…