-
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
migrating away from deprecated HOC #9654
Comments
export const withHooksHOC = (Component: any) => {
return (props: any) => {
const screenWidth = useScreenWidth();
return <YourClassBasedComponent width={screenWidth} {...props} />;
};
}; |
@petyavok Thanks for the question. You can try posting this in our Apollo Community for guidance from other Apollo users, as other's may have input into your question. I'll leave this open an issue as well, in case others have ideas. |
Hi @petyavok 👋 I'm doing a bit of housekeeping and came across this issue. I don't have any advice to add here, but I wanted to give you a heads up that the deprecated HOC APIs (deprecated since 2020) will be indicated as deprecated in 3.9 onward in their respective docblocks, so you will see that in your IDE if using TypeScript. I'm going to go ahead and close this issue, but please feel free to ask any usage-related questions like this in our Discord going forward. 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. |
Hi,
What is the best way to migrate away from the deprecated hocs in apollo client?
https://www.apollographql.com/docs/react/api/react/hoc/
It would be extremely difficult for us to use hooks, since all of our components are built on recompose and class based components, which would need a complete rewrite.
Do any of you know a still maintained drop-in replacement with zero or minimal changes required, for the graphql() hoc?
We also evaluated creating our own hoc implementation based on the deprecated one, but it doesn’t seem like an easy solution, if we want to cover all the features it has.
If anyone has a suggestion, or was in the same situation please let me know, thanks.
The text was updated successfully, but these errors were encountered: