MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / updateProperties$1

Function updateProperties$1

code/new-context-api/public/app.js:15895–15926  ·  view source on GitHub ↗
(domElement, updatePayload, tag, lastRawProps, nextRawProps)

Source from the content-addressed store, hash-verified

15893
15894// Apply the diff.
15895function updateProperties$1(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
15896 // Update checked *before* name.
15897 // In the middle of an update, it is possible to have multiple checked.
15898 // When a checked radio tries to change name, browser makes another radio's checked false.
15899 if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {
15900 updateChecked(domElement, nextRawProps);
15901 }
15902
15903 var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
15904 var isCustomComponentTag = isCustomComponent(tag, nextRawProps);
15905 // Apply the diff.
15906 updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag);
15907
15908 // TODO: Ensure that an update gets scheduled if any of the special props
15909 // changed.
15910 switch (tag) {
15911 case 'input':
15912 // Update the wrapper around inputs *after* updating props. This has to
15913 // happen after `updateDOMProperties`. Otherwise HTML5 input validations
15914 // raise warnings and prevent the new value from being assigned.
15915 updateWrapper(domElement, nextRawProps);
15916 break;
15917 case 'textarea':
15918 updateWrapper$1(domElement, nextRawProps);
15919 break;
15920 case 'select':
15921 // <select> value update needs to occur after <option> children
15922 // reconciliation
15923 postUpdateWrapper(domElement, nextRawProps);
15924 break;
15925 }
15926}
15927
15928function getPossibleStandardName(propName) {
15929 {

Callers

nothing calls this directly

Calls 6

updateCheckedFunction · 0.70
isCustomComponentFunction · 0.70
updateDOMPropertiesFunction · 0.70
updateWrapperFunction · 0.70
updateWrapper$1Function · 0.70
postUpdateWrapperFunction · 0.70

Tested by

no test coverage detected