What is React Hot Loader? [closed]
Asked Answered
D

1

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 :)

Dichlamydeous answered 6/2, 2017 at 21:36 Comment(3)
From the documentation: "React Hot Loader is a plugin for Webpack that allows instantaneous live refresh without losing state while editing React components."Idolum
you have an idea how it works behind ?Dichlamydeous
What a great question! I am quite sad that it is closed, explanation around the topic would've been very helpful...Separatrix
R
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

Ra answered 6/2, 2017 at 21:42 Comment(3)
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 callDichlamydeous
@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.Ra
@KelvinDeMoya, Is react-hot-reloading for development environment?Move

© 2022 - 2024 — McMap. All rights reserved.