@blocklet/pages-kit 0.6.34 → 0.6.36
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.
|
@@ -298,17 +298,14 @@ function usePreloadComponent({ instanceId, componentId, properties, locale, dev
|
|
|
298
298
|
if (instanceId) {
|
|
299
299
|
const key = [instanceId, realLocale].join('-');
|
|
300
300
|
const componentState = customComponentStates().getState();
|
|
301
|
-
COMPONENT_LOADER_MAP[key] ??=
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
// 如果前置 preload 已经触发过了,直接返回,不再触发下面的 /preload 逻辑
|
|
310
|
-
if (previousRef.current) {
|
|
311
|
-
return previousRef.current;
|
|
301
|
+
COMPONENT_LOADER_MAP[key] ??= componentState.loadComponents({
|
|
302
|
+
mode: dev?.mode,
|
|
303
|
+
projectId: dev?.projectId ?? window.__PROJECT_ID__,
|
|
304
|
+
locale: realLocale,
|
|
305
|
+
instances: [{ id: instanceId, component: { id: componentId }, properties }],
|
|
306
|
+
});
|
|
307
|
+
if (previousRef.current)
|
|
308
|
+
return previousRef.current;
|
|
312
309
|
}
|
|
313
310
|
return null;
|
|
314
311
|
}
|