Skip to main content
Fast Refresh is a React Native feature that allows you to get near-instant feedback for changes in your React components. It’s an improvement over the previous Hot Reloading implementation.

What is Fast Refresh?

Fast Refresh is a feature that:
  • Preserves component state during edits
  • Only updates the code that changed
  • Catches errors during render and displays them in the app
  • Works with function components and Hooks
  • Provides immediate visual feedback

How It Works

When you save a file, Fast Refresh:
  1. Detects the changed module through Metro bundler
  2. Re-evaluates that module and its dependencies
  3. Updates the app without losing component state
  4. Shows a visual indicator that refresh occurred

HMR Client

Fast Refresh is powered by Metro’s Hot Module Replacement (HMR) system:

Enabling Fast Refresh

iOS

  1. Open Developer Menu: Cmd + D (Simulator) or shake device
  2. Enable “Fast Refresh”
  3. The setting persists across app reloads

Android

  1. Open Developer Menu: Cmd/Ctrl + M (Emulator) or shake device
  2. Enable “Fast Refresh”
  3. The setting persists across app reloads

Programmatically

What Gets Refreshed?

Function Components

When you edit this component, the count state is preserved.

Class Components

Class component state is preserved, but editing lifecycle methods may require a full reload.

State Preservation Rules

Preserved State

State is preserved when you edit:
  • Component render logic
  • Event handlers
  • Effects and their dependencies
  • Styles
  • Non-exported helper functions

Reset State

State resets when you edit:
  • Exports from the module
  • Hook call order
  • Hook types (useState → useReducer)
  • Component signature changes

Error Recovery

Fast Refresh catches errors and displays them:

Syntax Errors

Fast Refresh shows:
  • The error message
  • File and line number
  • Code frame with the error
Fix the error and save - the app recovers automatically!

Runtime Errors

Fast Refresh displays:
  • Red error screen
  • Stack trace
  • Error boundary information
The error is shown in LogBox:

Hooks Support

Fast Refresh has first-class support for Hooks:

useState

useEffect

Custom Hooks

Limitations

Module Exports

Changing exports causes a full reload:

Class Components

Anonymous Functions

Higher-Order Components

Tips for Best Experience

1. Use Function Components

2. Keep Components Small

3. Use Named Exports

4. Extract Complex Logic

Troubleshooting

Try these solutions:
  1. Check that Fast Refresh is enabled in Dev Menu
  2. Restart Metro bundler: npm start -- --reset-cache
  3. Reload the app: shake device → “Reload”
  4. Check for syntax errors in your code
  5. Verify you’re using function components for best results
Common causes:
  1. Changing component props or signature
  2. Modifying exported constants
  3. Changing Hook call order
  4. Using anonymous function components
  5. HOC wrapping is changing
This happens when:
  1. You edit a file that exports non-component values
  2. You change class component lifecycle methods
  3. You modify files outside of components (utils, constants)
  4. Circular dependencies are detected

Performance Impact

Fast Refresh is designed to be fast:
  • Updates typically complete in < 100ms
  • Only changed modules are re-evaluated
  • No full app reload required
  • State preservation eliminates navigation overhead

Comparison

Developer Settings Integration

Fast Refresh integrates with React Native DevSettings:

Next Steps

Debugging

Learn about debugging tools and techniques

Metro

Configure Metro bundler for your project