Search⌘ K

Hot Module Replacement

Explore how to use Hot Module Replacement (HMR) in React to update your application code without refreshing the browser. This lesson helps you understand the benefits of HMR, including faster debugging, preserving application state, and enhancing productivity during development.

We'll cover the following...

Hot Module Replacement (HMR) is a tool for reloading your application in the browser without the page refresh. Hot Module Replacement can be used in the src/index.js file to improve your experience as a developer. By default, create-react-app will cause the browser to refresh the page whenever its source code is modified. Try it by changing the helloWorld variable in your src/App.js file, which should cause the browser to refresh the page. There is a better way of handling source code changes during development, however. ...