Skip to content

Infinite rerender loop #8759

Answered by MathisEngels
MathisEngels asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @TkDodo, thanks for answering:

After a lot of debugging, I found what triggered the infinite re-render loop.

In WishlistPanel.tsx, I had a TanStack Table displaying profile related data.
Before displaying this data, I was doing something like:

export default function WishlistPanel() {
  const [itemQuery, profileQuery] = useSuspenseQueries({
    queries: [
      { queryKey: ["items"], queryFn: getItemsAPI(...) },
      { queryKey: ["profile"], queryFn: () => getProfile(someUUID) },
    ],
  });

  const items: WishlistItem[] = [];
  for (let i = 0; i < profileQuery.data.wishlist.items.length; i++) {
    const wishlistItem = profileQuery.data.wishlist.items[i];
    const item = itemQuery.d…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MathisEngels
Comment options

Answer selected by MathisEngels
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants