-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
fix(gatsby): add runtime check for react 17 #27468
Conversation
Tested with latest react. I've added to a page
with previous gatsby I got
now I don't get an error 👍 |
Also for some paper trail - this become a problem now because React@16.14 added the jsx transform ( https://github.com/facebook/react/blob/master/CHANGELOG.md#16140-october-14-2020 ) and was released yesterday and Mdx in particular doesn't seem compatible for now with it (?), causing errors like Ward described above ( https://app.circleci.com/pipelines/github/gatsbyjs/gatsby/50975/workflows/341312ae-79b4-41c2-a6d9-c31e5cae080d/jobs/526766 ) |
ya'll this is annoying. We can't upgrade to react 17 because the ecosystem doesn't support this automatic runtime yet |
@jquense what's the issue? We add the automatic rule when you're using react 17 |
you still have the same errors as folks this was trying to fix. e.g. emotion, mdx, system-ui and most libraries that depend on jsx pragma do not support the automatic runtime and break even on react 17. Basically this isn't just a matter of using react 17. Libraries have to all update to support the new jsx transform. opting everyone into a poorly supported feature isn't great |
basically by opting everyone into this for react 17 it gates everyones ability to upgrade to react 17 to whenever all these other libraries (which do support react 17) figure out jsx automatic runtime support |
@jquense okay so we should disable it completely. Sounds good. |
or make it a configuration so the user is able to enable to disable depending upon their needs |
Description
Make sure we only make it a default for react 17+. Not all libraries have moved to support automatic mode.
Related Issues
Related #26652