React 18 introduces a new development-only check to Strict Mode. This new check automatically unmounts and remounts every component, whenever a component mounts for the first time, restoring the previous state on the second mount. If we used the useEffect() hook like this:.After refreshing the page, the output would be.

1m read timeFrom levelup.gitconnected.com
Post cover image
3 Comments

Sort: