@blocklet/pages-kit 0.5.53 → 0.5.54

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.
@@ -293,6 +293,11 @@ function usePreloadComponent({ instanceId, componentId, properties, locale, dev
293
293
  previousRef.current = result;
294
294
  return result;
295
295
  }
296
+ const isProduction = dev?.mode === 'production';
297
+ // 在 production 模式下,如果前置 preload 已经触发过了,直接返回,不再触发下面的 /preload 逻辑
298
+ if (isProduction && previousRef.current) {
299
+ return previousRef.current;
300
+ }
296
301
  if (instanceId) {
297
302
  const key = [instanceId, realLocale].join('-');
298
303
  COMPONENT_LOADER_MAP[key] ??= customComponentStates()