Hot Module Replacement

A brief introduction to Hot Module Replacement and its use in React App.

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.

You can activate HMR in create-react-app by adding the following configuration to your src/index.js file:

Get hands-on with 1200+ tech skills courses.