Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAST_REFRESH behaviour #10539

Closed
hyperknot opened this issue Feb 10, 2021 · 2 comments · Fixed by #11105
Closed

FAST_REFRESH behaviour #10539

hyperknot opened this issue Feb 10, 2021 · 2 comments · Fixed by #11105

Comments

@hyperknot
Copy link

hyperknot commented Feb 10, 2021

  1. FAST_REFRESH is mentioned as experimental / unstable in the original release log
    here: Add experimental react-refresh support #8582 and here:

    // react-refresh is not 100% stable at this time,
    // which is why it's disabled by default.

  2. 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.

  3. Against what is written in the release log and source code comments, it is actually ENABLED by default today.

    FAST_REFRESH: process.env.FAST_REFRESH !== 'false',

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.

@ottoo
Copy link

ottoo commented 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
Copy link

n8sabes commented 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

FAST_REFRESH=false

Related CRA issues, include: #9904, #10078, #10539, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants