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
From the course: Building Modern Projects with React
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"…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Building a React project from scratch1m 53s
-
(Locked)
The React entry point3m 10s
-
(Locked)
Supporting ES61m 46s
-
(Locked)
The Index.js file and app component3m 31s
-
(Locked)
Building and serving with webpack7m 15s
-
(Locked)
Hot-reloading with react-hot-loader3m 9s
-
(Locked)
Meet the sample app52s
-
(Locked)
Creating the todoList component1m 58s
-
(Locked)
Creating the todoListItem component2m 14s
-
(Locked)
Creating the newTodoForm component3m 29s
-
(Locked)
Putting the app together1m 59s
-
-
-
-
-
-
-