From the course: Type-Safe Redux: Advanced Techniques with TypeScript
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Adding Redux middleware and DevTools - Redux Tutorial
From the course: Type-Safe Redux: Advanced Techniques with TypeScript
Adding Redux middleware and DevTools
- [Instructor] Let's now take a moment to talk about other probes that you can pass into the configureStore. Aside from the reducer, you can customize the store configuration further with options like DevTools and preloadedState. DevTools take a Boolean option that allows you to control whether or not Redux DevTools is enabled and by default, Redux DevTools are enabled in development mode and disabled in production, but you can customize this behavior to suit your needs. For example, if you want to enable Redux DevTools only in certain environments, you can pass your desired ENV value to it to dynamically toggle it based on the environment. The preloadedState option allows you to hydrate your Redux store with initial state. This is especially useful when you're dealing with server-side rendering or restoring state from local storage. You can pass an object here representing the initial store of your Redux store. Here is what is happening. We've created a preloadedState object that…