Today I Learned

Redux devtools config with redux-toolkit

When configuring redux store you have to manually enable devtools. Often they are only enabled in development environment.

Redux toolkit by default enables devtools on all environments. It is easy to overlook that and forget disabling devtools on production.

However some say having devtools enabled in production is not an issue.

  const store = configureStore({
    reducer: rootReducer,
    middleware: getDefaultMiddleware(),
    // do not forget this
    devTools: process.env.NODE_ENV !== 'production',