Skip to content

Conversation

@verekia
Copy link
Contributor

@verekia verekia commented Aug 29, 2021

This PR makes the DevTools client-side-only to avoid hydration issues (see #1774).

It renders ReactQueryDevtools as null during SSR, and then renders normally after mount.

I'm experiencing a failed test on my machine, even on the master branch without any change of mine:

Expected: "[\"query-2\"]"
    Received: "[\"query-1\"]"

      324 |     fireEvent.change(sortSelect, { target: { value: 'Last Updated' } })
      325 |     queries = await screen.findAllByText(/\["query-[1-3]"\]/)
    > 326 |     expect(queries[0]?.textContent).toEqual(query2Hash)
          |                                     ^
      327 |     expect(queries[1]?.textContent).toEqual(query3Hash)
      328 |     expect(queries[2]?.textContent).toEqual(query1Hash)
      329 | 

      at src/devtools/tests/devtools.test.tsx:326:37

With my changes, the failed test is different:

Expected: "[\"query-2\"]"
    Received: "[\"query-3\"]"

      324 |     fireEvent.change(sortSelect, { target: { value: 'Last Updated' } })
      325 |     queries = await screen.findAllByText(/\["query-[1-3]"\]/)
    > 326 |     expect(queries[0]?.textContent).toEqual(query2Hash)
          |                                     ^
      327 |     expect(queries[1]?.textContent).toEqual(query3Hash)
      328 |     expect(queries[2]?.textContent).toEqual(query1Hash)
      329 | 

      at src/devtools/tests/devtools.test.tsx:326:37

Maybe @prateek3255 would know what's going on?

@vercel
Copy link

vercel bot commented Aug 29, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tannerlinsley/react-query/EaLSCcNzVYPQNffv9C8rbG4pzJEv
✅ Preview: https://react-query-git-fork-verekia-master-tannerlinsley.vercel.app

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@TkDodo
Copy link
Collaborator

TkDodo commented Aug 29, 2021

I'm experiencing a failed test on my machine, even on the master branch without any change of mine:

hmm, it works fine on CI 🤷

@TkDodo TkDodo merged commit b46c646 into TanStack:master Aug 29, 2021
@tannerlinsley
Copy link
Member

🎉 This PR is included in version 3.21.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants