-
-
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 feature detection of React.startTransition #10569
Fix feature detection of React.startTransition #10569
Conversation
🦋 Changeset detectedLatest commit: 6069e2a The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
// Webpack + React 17 fails to compile on the usage of `React.startTransition` or | ||
// `React["startTransition"]` even if it's behind a feature detection of | ||
// `"startTransition" in React`. Moving this to a constant avoids the issue :/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd assume it's tied to the import * as React from "react"
import, the more typical usage is import React from "react"
.
Any chance of shipping this as is to un-break consumers btw? It's having pretty broad impact
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import React from "react"
is deprecated as of React 17
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know! 👍 Either way it's likely the reason why you saw this issue here but not in other places.
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
Tested the application with the fix |
I'm not quite sure why the current feature detection approach wasn't sufficient 😕 . It works fine in
vite
but apparently has issues inwebpack
. the react team doesn't do anything funny like this in theiruseSyncExternalStore
shim package and I can't imagine that has issues onwebpack
and React 17.Either way, moving to a constant seems to fix the webpack compilation issue.
Closes #10566