Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between Hot Reloading and Live Reloading in React Native?

I'm a bit confused here. When I'm debugging a React Native Application, I usually enable both Hot Reloading and Live Reloading. I want to know what is the difference between them?

like image 315
Raman Choudhary Avatar asked Jan 02 '17 14:01

Raman Choudhary


People also ask

What is live reload in react-native?

It is based on Hot Module Replacement (HMR). The process of hot reloading is different from live reloading. It only reads the changes made by us and reloads the component where they are made. The application doesn't have to read the app from the start, but it stays in the same state.

What is live reloading enabled?

Running with Live Reload Once Live Reload is enabled any change to an HTML page, CSS, JavaScript or Web Connection script causes the Web Browser to refresh the actively loaded page. The page position is saved whenever possible.

What is hot reload in programming?

Hot reload works by injecting updated source code files into the running Dart Virtual Machine (VM). After the VM updates classes with the new versions of fields and functions, the Flutter framework automatically rebuilds the widget tree, allowing you to quickly view the effects of your changes.

Does react support hot reload?

React Hot Loader is a plugin that allows React components to be live reloaded without the loss of state. It works with Webpack and other bundlers that support both Hot Module Replacement (HMR) and Babel plugins.


1 Answers

Live reloading reloads or refreshes the entire app when a file changes. For example, if you were four links deep into your navigation and saved a change, live reloading would restart the app and load the app back to the initial route.

Hot reloading only refreshes the files that were changed without losing the state of the app. For example, if you were four links deep into your navigation and saved a change to some styling, the state would not change, but the new styles would appear on the page without having to navigate back to the page you are on because you would still be on the same page.

like image 180
Nader Dabit Avatar answered Sep 28 '22 00:09

Nader Dabit