From the course: Building Modern Projects with React

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Hot-reloading with react-hot-loader

Hot-reloading with react-hot-loader

From the course: Building Modern Projects with React

Start my 1-month free trial

Hot-reloading with react-hot-loader

- (Instructor) So we've got a React app up and running which is great, but the problem, and granted, it's not a big problem by any means but still. The problem is that whenever we make a change to our code, for example, if we were to open up our app.js component and add some exclamation points, we have to physically refresh our browser in order to see the changes. And this is something we can fix pretty easily. Let's see how. So let's open up another terminal in our directory. I usually just leave webpac dev server running in the background, and we're going to run npm install save dev React hot loader and hit enter. And once that installs, we're going to open up app.js and add two little things. So first, at the top here, we're going to say, "Import hot from React hot loader." And then at the bottom, instead of just exporting our bare app component that we defined, we're going to say, "Export default hot parentheses module"…

Contents