gkeenley
gkeenley

Reputation: 7398

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?

Upvotes: 2

Views: 1540

Answers (1)

高鵬翔
高鵬翔

Reputation: 2057

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

Upvotes: 1

Related Questions