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

Function validateOptionProps

docs/index.js:20349–20375  ·  view source on GitHub ↗
(element, props)

Source from the content-addressed store, hash-verified

20347 (node.defaultValue = "" + value);
20348 }
20349 function validateOptionProps(element, props) {
20350 null == props.value &&
20351 ("object" === typeof props.children && null !== props.children
20352 ? React.Children.forEach(props.children, function (child) {
20353 null == child ||
20354 "string" === typeof child ||
20355 "number" === typeof child ||
20356 "bigint" === typeof child ||
20357 didWarnInvalidChild ||
20358 ((didWarnInvalidChild = !0),
20359 console.error(
20360 "Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>."
20361 ));
20362 })
20363 : null == props.dangerouslySetInnerHTML ||
20364 didWarnInvalidInnerHTML ||
20365 ((didWarnInvalidInnerHTML = !0),
20366 console.error(
20367 "Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected."
20368 )));
20369 null == props.selected ||
20370 didWarnSelectedSetOnOption ||
20371 (console.error(
20372 "Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."
20373 ),
20374 (didWarnSelectedSetOnOption = !0));
20375 }
20376 function getDeclarationErrorAddendum() {
20377 var ownerName = getCurrentFiberOwnerNameInDevOrNull();
20378 return ownerName

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…