MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / restoreStateOfTarget

Function restoreStateOfTarget

code/new-context-api/public/app.js:2888–2899  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

2886var restoreQueue = null;
2887
2888function restoreStateOfTarget(target) {
2889 // We perform this translation at the end of the event loop so that we
2890 // always receive the correct fiber here
2891 var internalInstance = getInstanceFromNode(target);
2892 if (!internalInstance) {
2893 // Unmounted
2894 return;
2895 }
2896 !(fiberHostComponent && typeof fiberHostComponent.restoreControlledState === 'function') ? invariant(false, 'Fiber needs to be injected to handle a fiber target for controlled events. This error is likely caused by a bug in React. Please file an issue.') : void 0;
2897 var props = getFiberCurrentPropsFromNode(internalInstance.stateNode);
2898 fiberHostComponent.restoreControlledState(internalInstance.stateNode, internalInstance.type, props);
2899}
2900
2901var injection$2 = ReactControlledComponentInjection;
2902

Callers 1

restoreStateIfNeededFunction · 0.70

Calls 1

invariantFunction · 0.70

Tested by

no test coverage detected