Check out a free preview of the full Redux Fundamentals (feat. React) course

The "Redux Dev Tools" Lesson is part of the full, Redux Fundamentals (feat. React) course featured in this preview video. Here's what you'd learn in this lesson:

Steve demonstrates how to install the Redux developer tools with the React application and describes the functionality that comes with it. The Redux developer tools adds extra functionality to allow developers to see what is going on in the Redux store.


Transcript from the "Redux Dev Tools" Lesson

>> One of the really powerful things that I would recommend installing, either Chrome or Firefox, whichever one makes you happier, are these Redux Dev Tools. The Redux Dev Tools adds an extra pain to your developer tools that allow you to kind of see what's going on in your Redux store.

So, this is one of those things where, before we're talking a little bit about like doesn't react come with a use reducer and I think there probably are plugins that will hook the use reducer up to these tools as well. But this is where we start to see like some of the tooling around Redux is super helpful for some of the more advanced cases that we'll see.

I mean, in this workshop, we won't even get to some of the like, fancier ways of managing async state like Redux observable and stuff along those lines. But there is a rich set of tools around this but very lightweight cases, use reducer is fine for more kind of production grade cases, you might want to consider using Redux you might end up there anyway.

I find myself almost always, as soon as the application grows to a certain size, going ahead and I'm finding myself needing to use the tools, to use Redux instead of the user reducer. So, these Developer Tools basically when you install it in Chrome, so if you don't have this installed in Chrome or Firefox, a lot of this will be kind of a, something we won't necessarily see.

But it basically puts this property on the window object. So we're gonna say, hey, if on the global window object, you have this read of Redux Dev Tools extension, then go ahead and call it and it's going to provide us an enhancer. So, we can actually say we can pull this in to our application.

Actually pull it into our store. We'll say const enhancer in this case. Great, and then if I did everything right, should be able to open up my Dev Tools and go to Redux. And see that I now have this set of tooling around everything is happening in my store, right now, we haven't like wired up any of our actions so, you can see that an event that we saw before.

I can see the current state in any given point, anytime an action is dispatched, I can look at the action, very much like we're doing that log enhancer and that log reducer or log middleware before. I can actually, every time the state changes, I can see the diff for how it changed.

There are some other cool tools around here, I can load in a JSON object, full of state for my application to create a place I'm trying to debug. I can also export based on the current state of the application, I can export it to a JSON file as well.

I can dispatch actions down here, and we don't have any actions yet, but I actually time travel through my application. If I want to dispatch a bunch of actions I want to rewind, then I can drag this bar back and I can go to previous states of my application, and I can play it forward again.

So, it's a really powerful set of tools that you can use in the application and it's frankly, just an enhancer, right? That we're kind of passing in there as well. And if you need to compose with other enhancers, you can absolutely do that as well, but it's there for you to kind of pull in.

If you use Redux toolkit which we'll see later, it is there for you kind of baked in automatically. For any of these things, if you don't wanna to ship them to production like even with our log enhancer from before, to answer a question we got in the chat, you can do like alright, if node n equals development, add these things in, otherwise, if it's production, don't add them in.

One of the fun things that you will see, though, if you have the Redux Dev Tools installed is a lot of times you'll just see it shipped to production you can actually like inspect applications you're using, they use Redux as as well. So, that's a fun, fun thing that you can do is like rewind, other production apps as well if they have these tools installed, but now we have it in place.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now