react-vant-nova 1.1.0-test → 1.1.1-test
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.
Potentially problematic release.
This version of react-vant-nova might be problematic. Click here for more details.
package/es/toast/method.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback,
|
|
2
|
+
import { useCallback, useState } from 'react';
|
|
3
|
+
import { useIsomorphicLayoutEffect } from '../hooks';
|
|
3
4
|
import { extend, isObject } from '../utils';
|
|
4
5
|
import { resolveContainer } from '../utils/dom/getContainer';
|
|
5
6
|
import { lockClick } from './lock-click';
|
|
@@ -77,7 +78,7 @@ const ToastObj = p => {
|
|
|
77
78
|
update.config = useCallback(nextState => {
|
|
78
79
|
setState(prev => typeof nextState === 'function' ? Object.assign(Object.assign({}, prev), nextState(prev)) : Object.assign(Object.assign({}, prev), nextState));
|
|
79
80
|
}, [setState]);
|
|
80
|
-
|
|
81
|
+
useIsomorphicLayoutEffect(() => {
|
|
81
82
|
setVisible(true);
|
|
82
83
|
if (!allowMultiple) syncClear();
|
|
83
84
|
toastArray.push(internalOnClosed);
|
package/lib/toast/method.js
CHANGED
|
@@ -18,6 +18,7 @@ function _jsxRuntime() {
|
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
+
var _hooks = require("../hooks");
|
|
21
22
|
var _utils = require("../utils");
|
|
22
23
|
var _getContainer = require("../utils/dom/getContainer");
|
|
23
24
|
var _lockClick = require("./lock-click");
|
|
@@ -97,7 +98,7 @@ const ToastObj = p => {
|
|
|
97
98
|
update.config = (0, _react().useCallback)(nextState => {
|
|
98
99
|
setState(prev => typeof nextState === 'function' ? Object.assign(Object.assign({}, prev), nextState(prev)) : Object.assign(Object.assign({}, prev), nextState));
|
|
99
100
|
}, [setState]);
|
|
100
|
-
(0,
|
|
101
|
+
(0, _hooks.useIsomorphicLayoutEffect)(() => {
|
|
101
102
|
setVisible(true);
|
|
102
103
|
if (!allowMultiple) syncClear();
|
|
103
104
|
toastArray.push(internalOnClosed);
|