Skip to content
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

Endless rerender when useQuery used with useTranslation from react-i18next in suspense mode #6184

Closed
two-legs opened this issue Apr 22, 2020 · 2 comments

Comments

@two-legs
Copy link

Actual outcome:

When I use hook useTranslation in Suspense mode (default) I'm getting endless rerender of the component:

const { data } = useQuery(GET_ITEM, {
    variables: {
      id: 'itemId',
    },
  });

  const { t } = useTranslation('common');

When I pass { useSuspense: false } to the useTranslation the page loads correctly.
With apollo-client 2.6 suspense mode works.

How to reproduce the issue:

Add useQuery and useTranslation to the one component.

Versions

"@apollo/client": "^3.0.0-beta.43",
"react-i18next": "^11.3.3",

System:
OS: macOS 10.15.3
Binaries:
Node: 12.14.1 - ~/.nvm/versions/node/v12.14.1/bin/node
Yarn: 1.22.4 - ~/.yarn/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v12.14.1/bin/npm
Browsers:
Chrome: 81.0.4044.113
Firefox: 73.0.1
Safari: 13.0.5

@hwillson
Copy link
Member

@two-legs we haven't added official React Suspense support to Apollo Client. This is on our list to do after we launch Apollo Client 3.0.

@lorensr
Copy link
Contributor

lorensr commented Aug 12, 2020

@two-legs you can track this issue for suspense support: apollographql/apollo-feature-requests#162

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants