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

ReactDOM.render is used instead of createRoot in DEV build #35094

Closed
2 tasks done
mwskwong opened this issue Mar 10, 2022 · 0 comments · Fixed by #35108
Closed
2 tasks done

ReactDOM.render is used instead of createRoot in DEV build #35094

mwskwong opened this issue Mar 10, 2022 · 0 comments · Fixed by #35108
Labels
topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine) type: bug An issue or pull request relating to a bug in Gatsby

Comments

@mwskwong
Copy link

mwskwong commented Mar 10, 2022

Preliminary Checks

Description

In DEV build, if React 18 (any minor versions) is used, render is being called instead of the new API createRoot.
Doesn't seem to affect PROD build.

image

Reproduction Link

https://github.com/mwskwong/react-18-rc-2-repo

Steps to Reproduce

  1. Create a Gatsby project using any templates
  2. Upgrade React to version 18, minor version doesn't matter here.
  3. Run in DEV build and observe the console in the browser

Expected Result

createRoot should be used in DEV build.

Actual Result

render is used in DEV build instead.

Environment

System:
    OS: Windows 10 10.0.22000
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
  Binaries:
    Node: 16.13.2 - C:\Program Files\nodejs\node.EXE
    npm: 8.1.2 - C:\Program Files\nodejs\npm.CMD
  Languages:
    Python: 3.10.2
  Browsers:
    Edge: Spartan (44.22000.120.0), Chromium (99.0.1150.36)
  npmPackages:
    gatsby: ^4.9.2 => 4.9.2

Config Flags

No response

@mwskwong mwskwong added the type: bug An issue or pull request relating to a bug in Gatsby label Mar 10, 2022
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 10, 2022
@LekoArts LekoArts added topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine) and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine) type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants