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

Function setInitialProperties

docs/index.js:16248–16478  ·  view source on GitHub ↗
(domElement, tag, props)

Source from the content-addressed store, hash-verified

16246 }
16247}
16248function setInitialProperties(domElement, tag, props) {
16249 switch (tag) {
16250 case "div":
16251 case "span":
16252 case "svg":
16253 case "path":
16254 case "a":
16255 case "g":
16256 case "p":
16257 case "li":
16258 break;
16259 case "img":
16260 listenToNonDelegatedEvent("error", domElement);
16261 listenToNonDelegatedEvent("load", domElement);
16262 var hasSrc = !1,
16263 hasSrcSet = !1,
16264 propKey;
16265 for (propKey in props)
16266 if (props.hasOwnProperty(propKey)) {
16267 var propValue = props[propKey];
16268 if (null != propValue)
16269 switch (propKey) {
16270 case "src":
16271 hasSrc = !0;
16272 break;
16273 case "srcSet":
16274 hasSrcSet = !0;
16275 break;
16276 case "children":
16277 case "dangerouslySetInnerHTML":
16278 throw Error(formatProdErrorMessage(137, tag));
16279 default:
16280 setProp(domElement, tag, propKey, propValue, props, null);
16281 }
16282 }
16283 hasSrcSet &&
16284 setProp(domElement, tag, "srcSet", props.srcSet, props, null);
16285 hasSrc && setProp(domElement, tag, "src", props.src, props, null);
16286 return;
16287 case "input":
16288 listenToNonDelegatedEvent("invalid", domElement);
16289 var defaultValue = (propKey = propValue = hasSrcSet = null),
16290 checked = null,
16291 defaultChecked = null;
16292 for (hasSrc in props)
16293 if (props.hasOwnProperty(hasSrc)) {
16294 var propValue$186 = props[hasSrc];
16295 if (null != propValue$186)
16296 switch (hasSrc) {
16297 case "name":
16298 hasSrcSet = propValue$186;
16299 break;
16300 case "type":
16301 propValue = propValue$186;
16302 break;
16303 case "checked":
16304 checked = propValue$186;
16305 break;

Callers 14

beginWorkFunction · 0.85
completeWorkFunction · 0.85
preconnectAsFunction · 0.85
preloadFunction · 0.85
preloadModuleFunction · 0.85
preinitStyleFunction · 0.85
preinitScriptFunction · 0.85
preinitModuleScriptFunction · 0.85
preloadStylesheetFunction · 0.85
acquireResourceFunction · 0.85
suspendResourceFunction · 0.85

Calls 15

formatProdErrorMessageFunction · 0.85
setPropFunction · 0.85
initInputFunction · 0.85
trackFunction · 0.85
updateOptionsFunction · 0.85
initTextareaFunction · 0.85
isCustomElementFunction · 0.85
setPropOnCustomElementFunction · 0.85
validateInputPropsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…