1

如果我禁用了 redux devtools,则应用页面无法正确呈现,直到我单击页面内的任意位置。它不会在我的控制台上显示任何错误。

我的商店模块是

imports: [
    StoreModule.forRoot(reducers, { metaReducers }),
    EffectsModule.forRoot(effects),
    StoreDevtoolsModule.instrument({ maxAge: 25 }),
    // !environment.production && remote flag (dev) & authenticated ? StoreDevtoolsModule.instrument({ maxAge: 25 }) : [],
    StoreRouterConnectingModule.forRoot({
      serializer: CustomSerializer,
    }),
  ]
4

1 回答 1

2

将选项 strictActionWithinNgZone 设置为 true(默认为 false)。并检查您是否会在商店更新期间收到错误。看起来你在区域外派出行动。

strictActionWithinNgZone
The strictActionWithinNgZone check verifies that Actions are dispatched by asynchronous tasks running within NgZone. Actions dispatched by tasks, running outside of NgZone, will not trigger ChangeDetection upon completion and may result in a stale view.

在这里查看https://ngrx.io/guide/store/configuration/runtime-checks

于 2020-10-19T13:48:35.373 回答