Skip to content

Instantly share code, notes, and snippets.

@inactivist
Last active July 17, 2020 18:46
Show Gist options
  • Save inactivist/3b7c7999dec29f29378d8a52788021d7 to your computer and use it in GitHub Desktop.
Save inactivist/3b7c7999dec29f29378d8a52788021d7 to your computer and use it in GitHub Desktop.
Enable Hot Module Reload (HMR) in React-360

Didn't see this mentioned in docs, so:

To enable HMR:

Append ?hotreload=true to the page URL (assuming this only works in dev mode)

Example:

http://localhost:8081/index.html?hotreload=true

From Runtime.js source:

const HOTRELOAD_FLAG = /\bhotreload\b/;

Reference

      if (HOTRELOAD_FLAG.test(location.search)) {
        enableHotReload = true;
        if (bundleURL.indexOf('?') > -1) {
          bundleURL += '&hot=true';
        } else {
          bundleURL += '?hot=true';
        }
      }
    }

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment