MCPcopy Create free account
hub / github.com/caseywebdev/react-list / checkControlledValueProps

Function checkControlledValueProps

docs/index.js:20028–20049  ·  view source on GitHub ↗
(tagName, props)

Source from the content-addressed store, hash-verified

20026 allNativeEvents.add(dependencies[registrationName]);
20027 }
20028 function checkControlledValueProps(tagName, props) {
20029 hasReadOnlyValue[props.type] ||
20030 props.onChange ||
20031 props.onInput ||
20032 props.readOnly ||
20033 props.disabled ||
20034 null == props.value ||
20035 ("select" === tagName
20036 ? console.error(
20037 "You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set `onChange`."
20038 )
20039 : console.error(
20040 "You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."
20041 ));
20042 props.onChange ||
20043 props.readOnly ||
20044 props.disabled ||
20045 null == props.checked ||
20046 console.error(
20047 "You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`."
20048 );
20049 }
20050 function isAttributeNameSafe(attributeName) {
20051 if (hasOwnProperty.call(validatedAttributeNameCache, attributeName))
20052 return !0;

Callers 2

setInitialPropertiesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…