Description
-
FAST_REFRESH is mentioned as experimental / unstable in the original release log
here: Add experimental react-refresh support #8582 and here:
create-react-app/packages/react-scripts/config/env.js
Lines 97 to 98 in 3f5dea9
-
I can confirm it's very unstable / unusable today. It doesn't detect any change in non-UI components, for example MobX stores, thus the whole refresh is broken, I always have to reload manually now.
-
Against what is written in the release log and source code comments, it is actually ENABLED by default today.
I believe this line need to be changed to === 'true'
, to make it disabled by default. Also, a small explanation should be added to the next release log, this feature is really not documented at all.
Activity
ottoo commentedon Feb 12, 2021
I noticed an issue with the fast refresh and Apollo local state today as well. If I have fast refresh enabled, the very first value I get from the cache is
undefined
even though the value exists when I check Apollo devtools and local storage. We're using a boolean in the Apollo local state to denote that the user is logged in so when it's undefined the very first time, the user is logged out.n8sabes commentedon Feb 20, 2021
Initially, I thought
React Hot Loader
was broken with lazy loaded and async imported modules. However, upon further investigation, I agree with @hyperknot that Fast Refresh is enabled by default.Now, live edits ALWAYS FAIL TO REFRESH. While I have high hopes for Fast Refresh, the OPT-OUT workaround is a must:
.env
Related CRA issues, include: #9904, #10078, #10539, etc.