Search code examples
reactjsreact-nativereloadhot-reloadmetro-bundler

React Native: What exactly happens on hot reload / fast refresh?


I am running a React Native app in an iOS emulator, and have fast refresh turned on. It seems like when a fast refresh occurs, the constructor for the component is run, but componentDidMount is not.

**What I Want To Know: ** What exactly happens on a fast refresh? What are the steps that are executed?


Solution

  • As my experience, it will update the item what you change, if you don't change the code in componentDidMount, it will not change the render result caused by componentDidMount either, vice versa.

    There are detail introductions in react native document.

    Hot reload

    Fast Refresh