MCPcopy Create free account
hub / github.com/caseywebdev/react-list / acquireSingletonInstance

Function acquireSingletonInstance

docs/index.js:38058–38088  ·  view source on GitHub ↗
(
      type,
      props,
      instance,
      internalInstanceHandle
    )

Source from the content-addressed store, hash-verified

38056 }
38057 }
38058 function acquireSingletonInstance(
38059 type,
38060 props,
38061 instance,
38062 internalInstanceHandle
38063 ) {
38064 if (getInstanceFromNode(instance)) {
38065 var tagName = instance.tagName.toLowerCase();
38066 console.error(
38067 "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.",
38068 tagName,
38069 tagName,
38070 tagName
38071 );
38072 }
38073 switch (type) {
38074 case "html":
38075 case "head":
38076 case "body":
38077 break;
38078 default:
38079 console.error(
38080 "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React."
38081 );
38082 }
38083 for (tagName = instance.attributes; tagName.length; )
38084 instance.removeAttributeNode(tagName[0]);
38085 setInitialProperties(instance, type, props);
38086 instance[internalInstanceKey] = internalInstanceHandle;
38087 instance[internalPropsKey] = props;
38088 }
38089 function getHoistableRoot(container) {
38090 return "function" === typeof container.getRootNode
38091 ? container.getRootNode()

Callers

nothing calls this directly

Calls 2

getInstanceFromNodeFunction · 0.85
setInitialPropertiesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…