11

I used react on several of my project is that it was well passed, but it is last time I saw that there is a react-hot-reload

  1. What is react-hot-loader?
  2. What is its use?
  3. difference between Hot Module Replacement in Webpack and React Hot Loader ?
  4. What is the advantage it will bring to the workflow?
  5. how it works behind

can anyone explain me plz :)

Hajji Tarik
  • 1,072
  • 7
  • 23
  • 2
    [From the documentation](https://gaearon.github.io/react-hot-loader/getstarted/): "*React Hot Loader is a plugin for Webpack that allows instantaneous live refresh without losing state while editing React components.*" – Frxstrem Feb 06 '17 at 21:40
  • you have an idea how it works behind ? – Hajji Tarik Feb 06 '17 at 21:42
  • What a great question! I am quite sad that it is closed, explanation around the topic would've been very helpful... – Emixam23 Jan 13 '22 at 07:33

1 Answers1

9

React Hot Loader is a React library used to edit your code and automatically reflect that change in your running app while keeping the components mounted, which means you don't need to refresh your browser and you won't lose your current state. It's pretty convenient as you won't have to go step-by-step to test a specific state in your app every time you make a change in the code.

Your workflow would be faster, simpler and more comfortable.

Here's a live demo: http://gaearon.github.io/react-hot-loader/

Edit: React Hot Loader is now deprecated, use React Fast Refresh

deadcoder0904
  • 7,232
  • 12
  • 66
  • 163
Kelvin De Moya
  • 5,118
  • 1
  • 17
  • 16
  • If for example I change a component that makes an async call, will react-hot-reload make the call without reloading or I would have to refresh to make my call – Hajji Tarik Feb 06 '17 at 21:46
  • @HajjiTarik It depends where you are making that call, if it's inside componentDidMount it shouldn't make that call again as the library keeps the component mounted. If it's being called from inside the render function, for example, you should be able to make that call again without reloading. – Kelvin De Moya Feb 06 '17 at 22:14
  • @KelvinDeMoya, Is `react-hot-reloading` for development environment? – AmerllicA May 22 '18 at 12:02