diff --git a/config/plugins/webpack.md b/config/plugins/webpack.md index bf4eb79..f83c2b0 100644 --- a/config/plugins/webpack.md +++ b/config/plugins/webpack.md @@ -377,6 +377,26 @@ webpack({ }); ``` +### Hot Reloading for React + +If you're using React components, you may want to have HMR automatically pick up a change and reload the component without having to manually refresh the page. This is possible by installing [`react-hot-loader`](https://github.com/gaearon/react-hot-loader) to define which modules should be hot reloaded. + +Here's a usage example in TypeScript with `App` being the topmost component in a React component tree: + +```typescript +import { hot } from "react-hot-loader"; + +const App: FunctionComponent = () => ( +