@rc-component/portal 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/Portal.js CHANGED
@@ -54,7 +54,10 @@ const Portal = /*#__PURE__*/React.forwardRef((props, ref) => {
54
54
  const customizeContainer = getPortalContainer(getContainer);
55
55
 
56
56
  // Tell component that we check this in effect which is safe to be `null`
57
- setInnerContainer(customizeContainer ?? null);
57
+ setInnerContainer(() =>
58
+ // React do the state update even the value is the same,
59
+ // Use function call to force React to compare update
60
+ customizeContainer ?? null);
58
61
  });
59
62
  const [defaultContainer, queueCreate] = useDom(mergedRender && !innerContainer, debug);
60
63
  const mergedContainer = innerContainer ?? defaultContainer;
package/lib/Portal.js CHANGED
@@ -63,7 +63,10 @@ const Portal = /*#__PURE__*/React.forwardRef((props, ref) => {
63
63
  const customizeContainer = getPortalContainer(getContainer);
64
64
 
65
65
  // Tell component that we check this in effect which is safe to be `null`
66
- setInnerContainer(customizeContainer ?? null);
66
+ setInnerContainer(() =>
67
+ // React do the state update even the value is the same,
68
+ // Use function call to force React to compare update
69
+ customizeContainer ?? null);
67
70
  });
68
71
  const [defaultContainer, queueCreate] = (0, _useDom.default)(mergedRender && !innerContainer, debug);
69
72
  const mergedContainer = innerContainer ?? defaultContainer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rc-component/portal",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "React Portal Component",
5
5
  "keywords": [
6
6
  "react",