Skip to content

Instantly share code, notes, and snippets.

@yukeehan
Created December 3, 2018 19:09
Show Gist options
  • Save yukeehan/12270c6109e7a15529f87ddc7b9771b0 to your computer and use it in GitHub Desktop.
Save yukeehan/12270c6109e7a15529f87ddc7b9771b0 to your computer and use it in GitHub Desktop.
Hot Module Replacement (HMR) is a tool for reloading your application in the browser without the page refresh.
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
ReactDOM.render(
<App />,
document.getElementById('root')
);
if (module.hot) {
module.hot.accept();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment