-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Make useRenderGuard and profile work with React 19 #11795
Conversation
@Tobbe: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/ |
👷 Deploy request for apollo-client-docs pending review.Visit the deploys page to approve it
|
🦋 Changeset detectedLatest commit: 951ff42 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
const reactInternals = | ||
(React as any).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED || | ||
(React as any) | ||
.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; | ||
return reactInternals?.ReactCurrentDispatcher?.current; |
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.
Does that PR also fix the bundler issue you are encountering?
I'm a bit afraid that looking for both
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
and
__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE
might now trigger more "export not found" compiler warnings than before
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.
As long as I do import React from 'rehackt'
instead of import * as Rea...
it works without warnings with that code
Thanks for the PR! We found a way to do this without accessing React internals at all over in #11888, which is probably less flaky in the long run, so I'm going to close this :) |
React 19 has changed the names of some internal variables. This PR updates the @apollo/client React integration to also support these new names.
The React changes were introduced here facebook/react@f613165
Also updating the version of @testing-library/react to a version that supports React 19.
Support was introduced in https://github.com/testing-library/react-testing-library/releases/tag/v14.3.0