@blocklet/pages-kit 0.6.33 → 0.6.34
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,14 +298,13 @@ 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
|
-
});
|
|
301
|
+
COMPONENT_LOADER_MAP[key] ??= Promise.resolve(componentState.getComponent({ componentId, locale: realLocale ?? dev?.defaultLocale ?? 'en' }) ??
|
|
302
|
+
componentState.loadComponents({
|
|
303
|
+
mode: dev?.mode,
|
|
304
|
+
projectId: dev?.projectId ?? window.__PROJECT_ID__,
|
|
305
|
+
locale: realLocale,
|
|
306
|
+
instances: [{ id: instanceId, component: { id: componentId }, properties }],
|
|
307
|
+
}));
|
|
309
308
|
}
|
|
310
309
|
// 如果前置 preload 已经触发过了,直接返回,不再触发下面的 /preload 逻辑
|
|
311
310
|
if (previousRef.current) {
|