Book a free call

React Native Hot Refresh: How Fast Refresh Works

React Native hot refresh applies your edited code to the running app in about a second, keeping the screen and its state. Learn how it works and how to fix it.

Hertiv engineering teamReviewed by a senior engineer
7 min read
React Native Hot Refresh: How Fast Refresh Works
On this page

Short answer

React Native hot refresh, called Fast Refresh, is a development feature that applies edited code to the running app without losing the current screen or its state. Introduced as the default in React Native 0.61, it re-runs only the changed files and re-renders the affected components, falling back to a full reload when the new code cannot safely map onto the running app.

What is React Native hot refresh?

React Native hot refresh, known in the framework as Fast Refresh, is the development feature that applies your edited code to the running app without losing the screen you are on or the state inside it. You save a file and the change appears on the device or simulator in about a second.

Fast Refresh became the default in React Native 0.61, replacing the older live reload and hot reload options. It works by re-running only the files you changed and the components that import them, then re-rendering the screen with the new code while keeping component state where it is safe to do so.

For teams building mobile apps, this is a daily workflow feature rather than a release feature. It changes how fast a developer can iterate on a screen, because the feedback loop between editing and seeing the result is measured in seconds rather than a full rebuild. See mobile app development for how this fits into the wider build process.

How does Fast Refresh work under the hood?

Fast Refresh works by watching your files through the Metro bundler and, when one changes, sending only the updated module to the running app. The app then re-runs that module and the components that depend on it, and React re-renders the affected part of the tree.

The key idea is that React keeps a boundary around each component file. When a file changes, Fast Refresh re-executes it and asks React to re-render the components it defines, using the latest code. Components that were not changed are left alone, which is why the screen does not flash back to its first state.

State is kept because React preserves the component instance and its hooks when the new code is compatible with the old one. If you edited a component's render output, the state survives. If you changed the shape of the state itself, Fast Refresh cannot safely keep it and falls back to a full reload.

What state does Fast Refresh keep, and what does it lose?

Fast Refresh keeps local component state such as form values, toggles and the current tab, as long as the change is compatible with the existing state. That is the whole point: you can fix a style or a label while the form you are testing stays filled in.

It loses state when the edit changes the component's structure in a way React cannot map onto the old one. Renaming a component, changing the order of hooks, or editing the file that exports the component under a different name all break the mapping, and the app reloads from scratch.

It also loses state held outside React's tree, such as values stored in a module-level variable that the edited file re-initialises. Module state is re-run when the file is re-executed, so a counter or cache kept at the top of a module resets on every refresh. Keep shared state in a store or in React state if you need it to survive edits.

Fast Refresh vs live reload: what changed in 0.61?

Before 0.61, React Native offered two options. Live reload reloaded the whole app on every save, which lost all state. Hot reload tried to keep state but was unreliable: it often failed silently, left the app in a mixed state, or required a manual reload to recover.

Fast Refresh, introduced as the default in React Native 0.61, replaced both. It is more reliable because it only re-runs the changed module and its dependents, and it tells you clearly when it has to fall back to a full reload instead of silently leaving stale code on screen.

Behaviour Live reload Hot reload Fast Refresh
State after a save Lost, app restarts Kept, often unreliably Kept when the edit allows it
Speed Full restart each save Fast when it works About a second
Fallback None, always restarts Silent, stale code possible Clear full reload message
Status since 0.61 Replaced Replaced Default

The practical difference is trust. With live reload, developers saved and then waited for the app to restart. With Fast Refresh, developers save and keep working, because the screen they were testing is still there with its state intact. That is why the 0.61 change mattered even though the feature sounds small: it removed a constant source of wasted time from the development loop.

When Fast Refresh falls back to a full reload

Fast Refresh falls back to a full reload whenever it cannot safely map the new code onto the running app. The most common triggers are editing a file that is not a React component, changing the exports of a module, or editing a component's hooks in a way that changes their order or count.

Other triggers include editing the app entry file, changing a class component's methods in certain ways, and editing a file that another module imports for its side effects rather than for a component. In each case the bundler cannot tell which component instance the new code belongs to, so it reloads the app to be safe.

A full reload is not an error. It is the safe fallback, and the app should still start correctly. If you see a full reload after a small style change, something in the file is confusing the refresh boundary, and the usual cause is a component defined in the same file as another export. Splitting components into their own files usually fixes it.

How to fix hot refresh when it stops working

When hot refresh stops working, the cause is usually the setup rather than the code. Work through the checks in order, starting with the cheapest, before rebuilding anything.

  1. Check the dev menu. Open the developer menu on the device or simulator and confirm Fast Refresh is enabled; it can be toggled off by accident.
  2. Restart the Metro bundler. Stop the bundler, clear its cache with the reset flag, and start it again, since a stale cache is the most common cause.
  3. Check the file watcher. On some systems the watcher hits a limit on watched files; the bundler logs will say if files are not being watched.
  4. Look for a syntax error. A file that does not parse cannot be refreshed, and the error screen will show the failing file.
  5. Split shared files. If a component shares a file with other exports, move it to its own file so the refresh boundary is clear.
  6. Restart the app once. If none of the above helps, a single full reload clears any mixed state, and Fast Refresh usually works again after it.

If the problem repeats on one machine only, the cause is usually the local environment: a different Node version, a stale watchman install, or a case-sensitive file path that the bundler cannot match. Compare the setup with a machine where refresh works.

Example (hypothetical): a team debugging a checkout screen

Example (hypothetical): a team is debugging a checkout screen that only fails when the cart holds three items and a discount code is applied. Reproducing that state by hand takes about 40 seconds of tapping each time, so a full reload on every save would add that 40 seconds back to every edit.

With Fast Refresh, the developer edits the discount label and the change appears in about a second, with the three items and the discount code still in place. If the developer saves 30 times in an hour, that is 30 seconds of waiting instead of 30 times 40 seconds, which is 20 minutes. The saving is 19 minutes and 30 seconds in that hour, and the developer stays in the same test state throughout.

The arithmetic only holds because the state survives. The moment the developer edits the component's hooks or renames the file, Fast Refresh falls back to a full reload and the 40-second setup returns. That is why teams treat a sudden full reload as a signal to check the file structure, not as a random glitch.

What are the common mistakes?

The most common mistakes are treating Fast Refresh as a full reload, keeping important state in module variables, and assuming a change took effect when it did not.

  • Assuming the change applied. If the screen did not change, check the bundler output; a syntax error or a failed refresh leaves the old code running.
  • Keeping state in module variables. Module-level values reset on refresh, so state that must survive belongs in React state or a store.
  • Editing hooks mid-debug. Changing hook order forces a full reload and loses the state you were testing, so finish the test first.
  • Defining components in shared files. A component that shares a file with other exports confuses the refresh boundary and causes full reloads.
  • Ignoring the fallback message. The bundler says when it falls back to a full reload; treating that as noise hides a real file-structure problem.

Choosing between React Native and a native build is a separate decision; React Native vs native apps covers the trade-offs.

Budget is a separate question, and React Native app development cost covers what the choice means for it.

Key takeaways

  • Fast Refresh re-runs only changed files, so the screen and its state survive
  • State is lost when you change hook order, rename a component or edit a non-component file
  • Module-level variables reset on refresh; keep shared state in React state or a store
  • A sudden full reload usually means the file structure confuses the refresh boundary
  • Check the bundler output first when a change does not appear

Frequently asked questions

What is React Native hot refresh?

It is the development feature, called Fast Refresh, that applies your edited code to the running app without restarting it. You save a file and the change appears in about a second, with the screen and its state still in place.

How is Fast Refresh different from live reload?

Live reload restarted the whole app on every save and lost all state. Fast Refresh re-runs only the changed files and keeps component state, so you can edit a screen while the test state you set up stays in place.

Why does my app fully reload instead of refreshing?

The usual causes are editing a non-component file, changing hook order or count, renaming a component, or editing a file that exports other things alongside the component. Fast Refresh falls back to a full reload when it cannot map the new code safely.

Does Fast Refresh work with class components?

It works with class components for many edits, but function components with hooks are the most reliable case. Some edits to class methods still trigger a full reload, so function components are the safer choice for new code.

Can Fast Refresh lose my form data while testing?

Yes, if the edit changes the component's state shape or hook order. For normal edits to styles, labels and render output, form values and the current screen stay in place, which is the main benefit of the feature.

Is Fast Refresh available in production builds?

No. Fast Refresh is a development-only feature that runs through the Metro bundler. Production builds compile the code once, so there is nothing to refresh while the app is running.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: software products in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Building a React Native app and want the development loop to stay fast? Talk to Hertiv.

A senior engineer replies within one business day. Or see our Mobile App Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to contact@hertiv.com.

Prefer email? Write to contact@hertiv.com
Estimate costBook a call