Comparing version 5.21.3 to 5.21.4
import type * as React from 'react'; | ||
declare type ContainerType = Element | DocumentFragment; | ||
import type { Root } from 'react-dom/client'; | ||
declare const MARK = "__rc_react_root__"; | ||
declare type ContainerType = (Element | DocumentFragment) & { | ||
[MARK]?: Root; | ||
}; | ||
/** @private Test usage. Not work in prod */ | ||
@@ -4,0 +8,0 @@ export declare function _r(node: React.ReactElement, container: ContainerType): void; |
@@ -31,10 +31,10 @@ import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
var containerRoots = new Map(); | ||
var MARK = '__rc_react_root__'; | ||
function modernRender(node, container) { | ||
toggleWarning(true); | ||
var root = containerRoots.get(container) || createRoot(container); | ||
var root = container[MARK] || createRoot(container); | ||
toggleWarning(false); | ||
root.render(node); | ||
containerRoots.set(container, root); | ||
container[MARK] = root; | ||
} | ||
@@ -73,6 +73,6 @@ | ||
return _context.abrupt("return", Promise.resolve().then(function () { | ||
var _containerRoots$get; | ||
var _container$MARK; | ||
(_containerRoots$get = containerRoots.get(container)) === null || _containerRoots$get === void 0 ? void 0 : _containerRoots$get.unmount(); | ||
containerRoots.delete(container); | ||
(_container$MARK = container[MARK]) === null || _container$MARK === void 0 ? void 0 : _container$MARK.unmount(); | ||
delete container[MARK]; | ||
})); | ||
@@ -79,0 +79,0 @@ |
import type * as React from 'react'; | ||
declare type ContainerType = Element | DocumentFragment; | ||
import type { Root } from 'react-dom/client'; | ||
declare const MARK = "__rc_react_root__"; | ||
declare type ContainerType = (Element | DocumentFragment) & { | ||
[MARK]?: Root; | ||
}; | ||
/** @private Test usage. Not work in prod */ | ||
@@ -4,0 +8,0 @@ export declare function _r(node: React.ReactElement, container: ContainerType): void; |
@@ -49,10 +49,10 @@ "use strict"; | ||
var containerRoots = new Map(); | ||
var MARK = '__rc_react_root__'; | ||
function modernRender(node, container) { | ||
toggleWarning(true); | ||
var root = containerRoots.get(container) || createRoot(container); | ||
var root = container[MARK] || createRoot(container); | ||
toggleWarning(false); | ||
root.render(node); | ||
containerRoots.set(container, root); | ||
container[MARK] = root; | ||
} | ||
@@ -93,6 +93,6 @@ | ||
return _context.abrupt("return", Promise.resolve().then(function () { | ||
var _containerRoots$get; | ||
var _container$MARK; | ||
(_containerRoots$get = containerRoots.get(container)) === null || _containerRoots$get === void 0 ? void 0 : _containerRoots$get.unmount(); | ||
containerRoots.delete(container); | ||
(_container$MARK = container[MARK]) === null || _container$MARK === void 0 ? void 0 : _container$MARK.unmount(); | ||
delete container[MARK]; | ||
})); | ||
@@ -99,0 +99,0 @@ |
{ | ||
"name": "rc-util", | ||
"version": "5.21.3", | ||
"version": "5.21.4", | ||
"description": "Common Utils For React Component", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
196870
6030