01 / 01

What is Hot Module Replacement?

Hot Module Replacement (HMR) exchanges, adds, or removes modules while an application is running, without a full reload. This can significantly speed up development in a few ways:

  1. 1

    Retain application state which is lost during a full reload.

  2. 2

    Save valuable development time by only updating what's changed.

  3. 3

    Instantly update the browser when modifications are made to CSS/JS in the source code, which is almost comparable to changing styles directly in the browser's dev tools.

  4. 4

    HMR is an opt-in feature that only affects modules containing HMR code.