How React Fast Refresh works Implementations: https://github.com/facebook/react/blob/master/packages/react-refresh/src/ReactFreshBabelPlugin.js https://github.com/swc-project/swc/blob/master/ecmascript/transforms/react/src/refresh/mod.rs Additional reading: facebook/react#16604 (comment) https://github.com/facebook/react/blob/master/packages/react-refresh/src/__tests__/ReactFreshIntegration-test.js