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

Function updateProperties$1

code/communication/public/app.js:16569–16600  ·  view source on GitHub ↗
(domElement, updatePayload, tag, lastRawProps, nextRawProps)

Source from the content-addressed store, hash-verified

16567
16568// Apply the diff.
16569function updateProperties$1(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
16570 // Update checked *before* name.
16571 // In the middle of an update, it is possible to have multiple checked.
16572 // When a checked radio tries to change name, browser makes another radio's checked false.
16573 if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {
16574 updateChecked(domElement, nextRawProps);
16575 }
16576
16577 var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
16578 var isCustomComponentTag = isCustomComponent(tag, nextRawProps);
16579 // Apply the diff.
16580 updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag);
16581
16582 // TODO: Ensure that an update gets scheduled if any of the special props
16583 // changed.
16584 switch (tag) {
16585 case 'input':
16586 // Update the wrapper around inputs *after* updating props. This has to
16587 // happen after `updateDOMProperties`. Otherwise HTML5 input validations
16588 // raise warnings and prevent the new value from being assigned.
16589 updateWrapper(domElement, nextRawProps);
16590 break;
16591 case 'textarea':
16592 updateWrapper$1(domElement, nextRawProps);
16593 break;
16594 case 'select':
16595 // <select> value update needs to occur after <option> children
16596 // reconciliation
16597 postUpdateWrapper(domElement, nextRawProps);
16598 break;
16599 }
16600}
16601
16602function getPossibleStandardName(propName) {
16603 {

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