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

Suspense in useTransactionQuery doesn't trigger rerender in React on slow networks #1232

Open
lukaskirner opened this issue Nov 2, 2022 · 2 comments

Comments

@lukaskirner
Copy link

By using suspense in combination with useTransactionQuery no rerender is happening at slow network conditions which results in only showing the suspense fallback component. On fast network conditions, the code works as intended.

Example Code will only show Loading ... on the screen when using the throttled network (Slow 3G) in e.g. Chrome Dev Tools:

import { Suspense } from 'react';
import { useTransactionQuery } from 'src/gqty';

export const Parent = () => {
  return (
    <Suspense fallback={<h1>Loading...</h1>}>
      <Child />
    </Suspense>
  );
};

export const Child = () => {
  const { data } = useTransactionQuery((query) => query.hello, {
    suspense: true
  });

  return <h1>Data - {data}</h1>;
};

@Negan1911
Copy link

I'm seeing the same issue with usePaginatedQuery. The only one who looks not to be causing an issue is useQuery, I created a repro here: https://github.com/Negan1911/gqty-suspense-reproduction

@vicary
Copy link
Member

vicary commented Mar 23, 2023

We are rolling out an alpha via #1544, this issue is not happening in the new core. Please stay tuned!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants