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

fix(devtools): make sure that sort function is properly read from localStorage #3703

Conversation

zorzysty
Copy link
Collaborator

@zorzysty zorzysty commented Jun 12, 2022

Fix for: #3639: DevTools doesn't remember the sort function

This effect is causing the problem. Good news is that it's also completely unneeded as it's doubling what's already done via useLocalStorage. And if the runs after (which it usually does), it disregards the value that's read by useLocalStorage hook - which is exactly what causes the bug.

This is easily fixable by simply removing the effect.

@codecov-commenter
Copy link

codecov-commenter commented Jun 12, 2022

Codecov Report

Merging #3703 (f50c04c) into beta (e0aad73) will decrease coverage by 0.30%.
The diff coverage is 93.29%.

@@            Coverage Diff             @@
##             beta    #3703      +/-   ##
==========================================
- Coverage   97.11%   96.81%   -0.31%     
==========================================
  Files          50       57       +7     
  Lines        2391     2668     +277     
  Branches      706      784      +78     
==========================================
+ Hits         2322     2583     +261     
- Misses         67       83      +16     
  Partials        2        2              
Impacted Files Coverage Δ
packages/query-core/src/infiniteQueryObserver.ts 100.00% <ø> (ø)
packages/query-core/src/logger.ts 100.00% <ø> (ø)
packages/react-query-devtools/src/Logo.tsx 100.00% <ø> (ø)
...kages/react-query-devtools/src/styledComponents.ts 92.30% <ø> (ø)
packages/react-query-devtools/src/theme.tsx 100.00% <ø> (ø)
packages/react-query-devtools/src/useMediaQuery.ts 92.30% <ø> (ø)
...-persist-client/src/PersistQueryClientProvider.tsx 100.00% <ø> (ø)
packages/react-query-persist-client/src/persist.ts 92.85% <ø> (ø)
...ages/react-query/codemods/v4/key-transformation.js 97.36% <ø> (ø)
packages/react-query/codemods/v4/utils/index.js 98.50% <ø> (ø)
... and 67 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b25e964...f50c04c. Read the comment docs.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 13, 2022

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.

Latest deployment of this branch, based on commit f50c04c:

Sandbox Source
@tanstack/query-example-react-basic Configuration
@tanstack/query-example-react-basic-typescript Configuration

@zorzysty zorzysty force-pushed the issue-3639-_devtools_dont_remember_the_sort_function branch from 9c6e28f to c0587ff Compare July 13, 2022 18:24
@vercel
Copy link

vercel bot commented Jul 13, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
query ✅ Ready (Inspect) Visit Preview Jul 17, 2022 at 1:11PM (UTC)

@TkDodo TkDodo merged commit b0ca15b into TanStack:beta Jul 17, 2022
@zorzysty zorzysty deleted the issue-3639-_devtools_dont_remember_the_sort_function branch July 17, 2022 13:23
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

Successfully merging this pull request may close these issues.

3 participants