MCPcopy Create free account
hub / github.com/microsoft/SandDance / restoreStateOfTarget

Function restoreStateOfTarget

docs/external/js/react-dom.development.js:663–686  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

661 var restoreQueue = null;
662
663 function restoreStateOfTarget(target) {
664 // We perform this translation at the end of the event loop so that we
665 // always receive the correct fiber here
666 var internalInstance = getInstanceFromNode(target);
667
668 if (!internalInstance) {
669 // Unmounted
670 return;
671 }
672
673 if (!(typeof restoreImpl === 'function')) {
674 {
675 throw Error( "setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue." );
676 }
677 }
678
679 var stateNode = internalInstance.stateNode; // Guard against Fiber being unmounted.
680
681 if (stateNode) {
682 var _props = getFiberCurrentPropsFromNode(stateNode);
683
684 restoreImpl(internalInstance.stateNode, internalInstance.type, _props);
685 }
686 }
687
688 function setRestoreImplementation(impl) {
689 restoreImpl = impl;

Callers 1

restoreStateIfNeededFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected