18

In versions before 0.61 of react-native for reflecting code changes, we have two options.

  1. Live Reload (Reloads the app when detects some changes)
  2. Hot Reload (Reflect the changes without reloading)

but in the version 0.61, removing these two (Live Reload, Hot Reload) there is been a new developer feature introduced named Fast Refresh which also works similar to Hot Reload so now the question is what is the fundamental difference between Fast Refresh and Hot Reload.

Waheed Akhtar
  • 3,110
  • 1
  • 16
  • 30
  • See also [What is the difference between Hot Reloading and Live Reloading in React Native?](https://stackoverflow.com/questions/41428954/what-is-the-difference-between-hot-reloading-and-live-reloading-in-react-native) – cachius May 26 '23 at 08:30

2 Answers2

17

The “hot reloading” feature was broken. It didn’t work reliably for function components, often failed to update the screen, and wasn’t resilient to typos and mistakes. They heard that most people turned it off because it was too unreliable.

In React Native 0.61, they’re unifying the existing “live reloading” (reload on save) and “hot reloading” features into a single new feature called “Fast Refresh”. Fast Refresh was implemented from scratch with the following principles:

  • Fast Refresh fully supports modern React, including function components and Hooks.
  • Fast Refresh gracefully recovers after typos and other mistakes, and falls back to a full reload when needed.
  • Fast Refresh doesn’t perform invasive code transformations so it’s reliable enough to be on by default.

Read more from the official docs

abhikumar22
  • 1,764
  • 2
  • 11
  • 24
7

Fast refresh is great when we change the component for example style. It will only load the app on the current page. Most edits should be visible within a second or two.

Hot reload is to keep the app running and to inject new versions of the files that you edited at runtime.

for the Fast refresh If we edit a module that only exports React component(s), Fast Refresh will update the code only for that module and re-render your component.

If we edit a module with exports that aren't React components, Fast Refresh will re-run both that module and the other modules importing it.

If we edit a file that's imported by modules outside of the React tree, Fast Refresh will fall back to doing a full reload

In other words, it is great and more full than hot reload

RowanX
  • 1,272
  • 2
  • 14
  • 27
Lenoarod
  • 3,441
  • 14
  • 25