-
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
[Documentation Request] Explicit examples and/or best practices for querying from react class components #9413
Comments
Hi @kaysond 👋 I'm doing some housekeeping and came across this issue. While I recognize that the lack of documentation for usage within React class components has created some challenges for you and others in the past, Apollo Client's render prop and HOC APIs have been deprecated since 2020. In our upcoming 3.9 release, we've added a missing With that being said, I'm going to close this issue since we'd like to discourage use of these deprecated APIs and won't be fielding PRs to add this documentation. Please feel free to join our Discord where you can direct any questions about usage to the #frontend channel. Thanks! |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better. |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The current documentation has no mention of ReactJS class components, and this is a question that seems to come up: #7111, StackOverflow 1 Stack Overflow 2
Ok actually there is one tiny mention! In the section on typescript, there's a brief mention of Classes vs Functions which rightly points out that sometimes components depending on graphql data have state! Except the example uses
@apollo/react-hoc
which is deprecated.It would be great to have something more explicit here. It seems that most people have resorted to passing the client object around and running a
.query()
on it directly in a lifecycle function and updating component state. That's... clunky. Obviously HOC is not the best choice.I did notice the ApolloConsumer component docs mention that
Is there actually a
Context
here that can be used by the staticMyClass.contextType
?Thanks!
The text was updated successfully, but these errors were encountered: