MCPcopy Create free account
hub / github.com/plotly/dash / resolveForwardRefForHotReloading

Function resolveForwardRefForHotReloading

dash/deps/react-dom@18.3.1.js:27694–27731  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

27692 return resolveFunctionForHotReloading(type);
27693 }
27694 function resolveForwardRefForHotReloading(type) {
27695 {
27696 if (resolveFamily === null) {
27697 // Hot reloading is disabled.
27698 return type;
27699 }
27700
27701 var family = resolveFamily(type);
27702
27703 if (family === undefined) {
27704 // Check if we're dealing with a real forwardRef. Don't want to crash early.
27705 if (type !== null && type !== undefined && typeof type.render === 'function') {
27706 // ForwardRef is special because its resolved .type is an object,
27707 // but it's possible that we only have its inner render function in the map.
27708 // If that inner render function is different, we'll build a new forwardRef type.
27709 var currentRender = resolveFunctionForHotReloading(type.render);
27710
27711 if (type.render !== currentRender) {
27712 var syntheticType = {
27713 $$typeof: REACT_FORWARD_REF_TYPE,
27714 render: currentRender
27715 };
27716
27717 if (type.displayName !== undefined) {
27718 syntheticType.displayName = type.displayName;
27719 }
27720
27721 return syntheticType;
27722 }
27723 }
27724
27725 return type;
27726 } // Use the latest known implementation.
27727
27728
27729 return family.current;
27730 }
27731 }
27732 function isCompatibleFamilyForHotReloading(fiber, element) {
27733 {
27734 if (resolveFamily === null) {

Callers 3

mountLazyComponentFunction · 0.70
createWorkInProgressFunction · 0.70

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…