MCPcopy Index your code
hub / github.com/jaredpalmer/formik / pop

Method pop

packages/formik/src/FieldArray.tsx:319–336  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

317 handleRemove = (index: number) => () => this.remove<any>(index);
318
319 pop<T>(): T {
320 // Remove relevant pieces of `touched` and `errors` too!
321 let result: any;
322 this.updateArrayField(
323 // so this gets call 3 times
324 (array: any[]) => {
325 const tmp = array.slice();
326 if (!result) {
327 result = tmp && tmp.pop && tmp.pop();
328 }
329 return tmp;
330 },
331 true,
332 true
333 );
334
335 return result as T;
336 }
337
338 handlePop = () => () => this.pop<any>();
339

Callers 1

FieldArrayInnerClass · 0.95

Calls 1

popMethod · 0.65

Tested by

no test coverage detected