@canlooks/can-ui 0.0.183 → 0.0.184
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/dist/cjs/utils/hooks.js
CHANGED
|
@@ -145,8 +145,13 @@ function useContainer(container, effectContainer, defaultContainer) {
|
|
|
145
145
|
if (container) {
|
|
146
146
|
return typeof container === 'function' ? container() : container;
|
|
147
147
|
}
|
|
148
|
-
if (!prev
|
|
149
|
-
|
|
148
|
+
if (!prev) {
|
|
149
|
+
if (typeof defaultContainer !== 'undefined') {
|
|
150
|
+
return typeof defaultContainer === 'function' ? defaultContainer() : defaultContainer;
|
|
151
|
+
}
|
|
152
|
+
if (typeof document !== 'undefined') {
|
|
153
|
+
return document.body;
|
|
154
|
+
}
|
|
150
155
|
}
|
|
151
156
|
return prev;
|
|
152
157
|
}, [container]);
|
package/dist/esm/utils/hooks.js
CHANGED
|
@@ -130,8 +130,13 @@ export function useContainer(container, effectContainer, defaultContainer) {
|
|
|
130
130
|
if (container) {
|
|
131
131
|
return typeof container === 'function' ? container() : container;
|
|
132
132
|
}
|
|
133
|
-
if (!prev
|
|
134
|
-
|
|
133
|
+
if (!prev) {
|
|
134
|
+
if (typeof defaultContainer !== 'undefined') {
|
|
135
|
+
return typeof defaultContainer === 'function' ? defaultContainer() : defaultContainer;
|
|
136
|
+
}
|
|
137
|
+
if (typeof document !== 'undefined') {
|
|
138
|
+
return document.body;
|
|
139
|
+
}
|
|
135
140
|
}
|
|
136
141
|
return prev;
|
|
137
142
|
}, [container]);
|