0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
Commit graph

5,026 commits

Author SHA1 Message Date
Maciej Leszczyński
4bd66a3018
docs: Fix async/await syntax (#3543) 2022-04-21 15:18:34 +02:00
Alex Johansson
a325801d95
test: add test for status=error (#3411) v3.36.0 2022-04-21 14:21:08 +02:00
New Future
b7a07c2b6f
feat: add nonce for devtools style tag (#3506) 2022-04-21 14:18:47 +02:00
Dominik Dorfmeister
0c66727312
feat(react): add "support" for react18 (#3520) v3.35.0 2022-04-17 20:46:01 +02:00
Mohammad ali Ali panah
1ab13dc22e
fix(devtools): adjust QueryKey height (#3497) v3.34.20 2022-04-15 21:31:04 +02:00
Niels de Bruin
20c9838d39
docs: Fix typo on homepage (#3515) 2022-04-15 13:27:35 +02:00
Artem Golubenko
ec4ef9b753
docs: add a link to the v4 beta doc (#3496)
add a link in README.md pointing to the v4 beta doc

Co-authored-by: artem.golubenko <FbKA8CnEB8hrs5mt>
2022-04-11 21:17:57 +02:00
Satyajit Sahoo
70e3d47d23
docs: Improve readability of useRefreshOnFocus (#3465) 2022-04-09 14:29:51 +02:00
Tyler McGinnis
b992f897c4
Update Learn link and sidebar (#3486) 2022-04-08 11:38:32 -06:00
Benjamin Adam
b5675e9718
docs: Update links to course landing page (#3478) 2022-04-07 15:40:21 -06:00
Liam Tait
ba09e16b36
chore(eslint): Add react/jsx-key lint rule (#3447)
Rule is set to error.
option checkFragmentShorthand option set to true,  meaning the rule is used for shorthand fragment syntax too.
option will default to true next major eslint-plugin-react version

See rule docs [here](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-key.md)
2022-03-28 07:35:23 +02:00
Liam Tait
9f23b64396
fix(devtools): add keys to mapped entries for Explorer (#3446) v3.34.19 2022-03-27 14:08:07 +02:00
Tanner Linsley
538816015e Update comparison.md 2022-03-26 08:29:08 -06:00
Tanner Linsley
c4c90b323c Merge branch 'master' of https://github.com/tannerlinsley/react-query 2022-03-26 08:28:28 -06:00
Tanner Linsley
6f7d8aa8c3 Update comparison.md 2022-03-26 08:28:26 -06:00
Henrique Derosa
ba81870efb
fix(devtools): serialize bigint types (#3440) v3.34.18
* fix(devtools): serialize bigint types

* test(devtools): Add missing test for displayValue

* refactor: Improve code for displayValue function
2022-03-26 08:28:47 +01:00
Tanner Linsley
fc4671f073 docs: comparison 2022-03-24 14:21:28 -06:00
Tanner Linsley
e41f5c63af
docs: update comparison 2022-03-24 14:17:33 -06:00
Dominik Dorfmeister
31bcaf1b54
fix(useIsFetching): account for fetches happening in the same render cycle (#3438) v3.34.17
if a fetch happens in the same render cycle as useIsFetching is mounting, but it is mounted after the query, what happens is that:

- the initial state of `isFetching` is `0` because the effect to fetch the query hasn't started yet
- the query effect runs before the isFetching effect, which means we miss the event, thus the next event we get from the subscription gives us 0 again

so we need to check for isFetching in the effect that runs to set up the subscription as well. This catches fetches that basically started in the same effect cycle, but before "our" effect ran
2022-03-24 20:33:19 +01:00
Alex Anderson
ce61a2a594
docs: Add a backlink to bytes.dev (#3429)
* docs: updates for new react-query course

Change removes convert kit for email capture and migrates it to Bytes. Copy updates to promote the new React Query Course are included.

* Add the PPP discount banner for the ui.dev React Query course.

* Add a backlink to Bytes.

Co-authored-by: Benjamin Adam <benjamin.mark.adam@gmail.com>
2022-03-22 12:21:37 -06:00
Alex Anderson
0cbd1fdc02
docs: updates for new react-query course (#3414)
* docs: updates for new react-query course

Change removes convert kit for email capture and migrates it to Bytes. Copy updates to promote the new React Query Course are included.

* Add the PPP discount banner for the ui.dev React Query course.

Co-authored-by: Benjamin Adam <benjamin.mark.adam@gmail.com>
2022-03-22 10:25:49 -06:00
lironezra
16783feed1
docs: infinite scroll example uses react-intersection-observer (#3410) 2022-03-16 20:31:32 +01:00
Liam Tait
c6594df791
refactor(devtools): add types to Explorer (#2949)
* refactor(devtools): add types to Explorer

Add types to Explorer component with as minimal functional changes as
possible while still getting type safety

2742

* remove unused set param from explorer toggle

* Wrap Explorer toggle with useCallback

* Rename Explorer toggle to toggleExpanded

* Remove unused path

* Move subEntryPages definition next to usage

* Set type to be a string instead of string union

* Remove unused depth prop

* Move chunkArrays to own tested function

* set handleEntry as required

* Add LabelButton for accesibility

* fix test

* Remove shadowing

* Set subEntries as empty array by default

* Add type for property

* Convert handleEntry function to react component with entry props

* Use unknown for value

* Set RenderProps to required where possible

* Add required attributes to Explorer tests
2022-03-15 13:02:54 +01:00
Binaya Chaudhary
69cc49b7c5
docs: update gitpod link in contributing.md (#3376) 2022-03-13 09:15:48 +01:00
Ken Huh
feb8eb822a
docs: fix a typo in mutations.md (#3386) 2022-03-13 07:32:38 +01:00
ASchwad
7be6d89d68
docs: Extend simple example to handle failed request (#3322) 2022-03-03 20:28:40 +01:00
Eugene Dzhumak
3e8f499aba
docs: update rtk-query comparison.md (#3328)
rtk-query stars counter points to an archived repo.

Query now lives in the main repo as a package.

I understand that this isn't totally right, but at least it seems reasonable not to count start of an archived repo.
2022-02-25 19:59:11 +01:00
Dominik Dorfmeister
b44c213b39
fix(useQuery): pass query as second parameter to useErrorBoundary function(#2660) v3.34.16 2022-02-20 14:09:43 +01:00
Ikko Ashimine
eb4e863cf4
docs: Update CONTRIBUTING.md (#3299)
Github -> GitHub
github -> GitHub
2022-02-14 15:24:59 +01:00
allcontributors[bot]
e8338f92cd
docs: add zrwsk as a contributor for doc (#3297)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-02-14 10:55:00 +01:00
meskill
21fa86d21d
docs: add caveats about memory to ssr.md (#3290)
* docs: add caveats about memory to ssr.md

* revert style changes

* Update docs/src/pages/guides/ssr.md

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>

* Update docs/src/pages/guides/ssr.md

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2022-02-13 20:41:34 +01:00
Jakub Żurawski
f2bfc69285
docs(mutations): describe difference between using callbacks in useMu… (#3274)
* docs(mutations): describe difference between using callbacks in useMutation and .mutate

* Text corrections

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>

* add subheader

* update consecutive mutations case to better describe ordering of mutation calls and fulfillment

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2022-02-13 20:39:32 +01:00
Andrii Artemenko
9b5d18cd47
fix(devtools): add code element's background (#3287) v3.34.15
Prevent code element's backround from being overwritten
2022-02-12 20:15:33 +01:00
flash548
e3df8b1841
docs: Update useQuery.md (#3281)
was missing the placeholderData field on the `useQuery` options signature... but its listed in detail on the latter part of the page.
2022-02-12 18:49:02 +01:00
Tommy Tan
d8c46ce30a
docs: update testing.md (#3278)
fixes sentence by removing "our".
2022-02-08 22:43:35 +01:00
Ville Saukkonen
6d6d9d06cd
docs(setQueriesData): Make setQueriesData more searchable (#3244)
* docs(setQueriesData): Make setQueriesData more searchable

- Makes setQueriesData more searchable
- Change mention of fuzzily matching to partial matching since fuzzy matching is more arbitrary algorithm
- Mention setQueriesData in setQueryData to avoid confusion of behaviours

The purpose of this change is to make setQueriesData a bit more searchable from the docs to avoid confusion like this: https://github.com/tannerlinsley/react-query/discussions/3239

* Apply suggestions from code review

Co-authored-by: Ville Saukkonen <villesau@users.noreply.github.com>

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
2022-02-06 15:09:21 +01:00
Dominik Dorfmeister
b38eed6326 chore: fix prettier v3.34.14 2022-02-06 09:47:24 +01:00
Arty
a470f4601b
fix(types): useQueries to also handle array-params with typed QueryKey (#3267)
* fix(types): handle useQueries wrappers with strongly-typed array parameters

* test(types): confirm typecheck passes without explicit type for mapped query

* test(types): add typecheck on queryFn in mapped query
2022-02-06 09:33:59 +01:00
Arnaud
efb77d7c40
docs(cancellation): add graphql request v4 example (#3264) 2022-02-05 13:09:21 +01:00
Jeff Sims
a536773b00
fix(types): export QueriesOptions and QueriesResults types for useQueries (#3251) v3.34.13
* refactor(useQueries) export QueriesOptions type

export the QueriesOptions type

closes #3250

* refactor(useQueries): add export to index

Add the export of the QueriesOptions type to the index file

* refactor(useQueries) export QueriesResults type

Export QueriesResults type

Co-authored-by: Jeffrey Sims <jeffreysims@Jeffrey-Sims-Mac.local>
2022-02-05 08:34:37 +01:00
fediev
4dcb490d4d
docs(tests): infinite scroll without click more button (#3247)
On the first rendering, `hasNextPage` is `undefined`, but converted to `true` by the default value.

For intersection observer to trigger correctly without clicking more button, `hasNextPage` needs type casting.
2022-01-30 14:58:28 +01:00
Amen SOUISSI
6710bc1715
fix(types): use MutationKey instead of QueryKey for useIsMutating (#3222) v3.34.12 2022-01-23 16:47:23 +01:00
Dominik Dorfmeister
c532d81313
fix(core): make sure batching finishes if exception is thrown (#3216) v3.34.11
incrementing and decrementing transactions need to happen in an atomic operation, no matter what happens in between; if we increment, but never decrement, we will get to a state where transactions can never become zero - we're basically "leaking" an open transaction. This leads to no observers being informed ever again because we think we still have an open transaction

this can be fixed by using try/finally to always decrement the transactions
2022-01-21 13:24:22 +01:00
Bennett Dams
f5a0ceceae
docs(ssr): Hydration caveat for Next.js' rewrites (#3209) v3.34.10
Adds a small section for a caveat about hydration when using some specific feature/configuration of Next.js
2022-01-21 13:19:42 +01:00
Arty
11f4ea99c0
fix(useQueries): allow types to work with strongly typed QueryFunction + QueryKey (#3214) 2022-01-21 13:18:28 +01:00
Damian Osipiuk
26b39546cc
fix(types): export QueryClientConfig interface (#3203) v3.34.9 2022-01-21 13:10:11 +01:00
Arnaud
e328ca0bc3
docs(examples): react-native: regenerate yarn.lock (#3197)
Regenerate a clean yarn.lock file without versions issues.
2022-01-16 09:16:17 +01:00
Arnaud
56e3ba7a9c
docs(examples): react-native: update .gitignore to exclude lib folder (#3196) 2022-01-14 14:06:50 +01:00
Arnaud
6722d06d22
docs(examples): react-native basic app in typescript (#3174)
* examples: react-native

Same example as in the Expo snack but in Typescript

* docs(examples): react-native: add link to the typescript version in the repo

* fix: use proper type for onAppStateChange
2022-01-14 09:16:34 +01:00
Dominik Dorfmeister
755702dd78
fix(queryObserver): fix data stability (#3183) v3.34.8
by making sure to memoize the structurally shared version of data rather than the raw one
2022-01-12 14:53:10 +01:00