MCPcopy Index your code
hub / github.com/final-form/react-final-form / getInputChecked

Function getInputChecked

src/useField.ts:308–324  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

306 };
307
308 const getInputChecked = () => {
309 // Fix #869: Same as getInputValue - sync with current name
310 let value = state.name !== name
311 ? getIn(form.getState().values ?? {}, name)
312 : state.value;
313 if (type === "checkbox") {
314 value = parse(value, name);
315 if (_value === undefined) {
316 return !!value;
317 } else {
318 return !!(Array.isArray(value) && ~value.indexOf(_value));
319 }
320 } else if (type === "radio") {
321 return parse(value, name) === _value;
322 }
323 return undefined;
324 };
325
326 const input: FieldInputProps<FieldValue, T> = {
327 name,

Callers 1

checkedFunction · 0.85

Calls 1

parseFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…