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

5,011 commits

Author SHA1 Message Date
Niek Bosch
bd6c2b5416
feat: run selector if reference changes to enable use of dependencies (#1751) 2021-02-06 19:38:37 +01:00
Niek Bosch
7c08f330ec
fix: check if the navigator global is available before usage (#1755) 2021-02-06 19:38:10 +01:00
Niek Bosch
5bd3fa973b
fix: make sure state is not updated when unmounted (#1758) 2021-02-06 19:37:44 +01:00
Niek
79e1c17cbb test: add infinite query with initial data test 2021-02-06 16:07:58 +01:00
Niek Bosch
8e24ebdec1
fix: accept null values in mutate function (#1740) v3.7.1 2021-02-04 10:16:08 +01:00
Ashwin Gokhale
216453059f
feat(types): Add optional cancelRefetch field to ResultOptions interface (#1663) v3.7.0
* feat(types): Add optional cancelRefetch field to ResultOptions interface

* feat(docs): Add cancelRefetch documentation for the refetch function
2021-02-04 09:53:44 +01:00
Niek Bosch
397d8b71eb
fix: notify on updates between mounting and subscribing (#1737) v3.6.1 2021-02-04 08:50:29 +01:00
Mateusz Ciezczak
1032804426
chore(examples): update axios version in examples folder (#1679) 2021-02-02 19:35:23 +01:00
Rene Dellefont
003345d735
docs (useQuery): add some missing items to api (#1707)
The useQuery reference was missing some return value documentation as well as some option values.
2021-02-02 19:34:09 +01:00
siddtheone
bae0f7e851
docs: Adding missing config property (#1673)
From documentation below it seems, code example missing `mutationKey`
2021-02-02 19:32:41 +01:00
Chai
3840f290a2
docs: fix typo and links (#1683)
* docs(focusManager): typo

setFocsued -> setFocused

* docs(*): fix links

change #useInfiniteQuery to /reference/useInfiniteQuery
change #usequery to /reference/useQuery
2021-02-02 19:30:43 +01:00
Derrick Bol
ce6756bf61
docs: Fix broken link to query-keys docs (#1719) 2021-02-02 19:29:17 +01:00
Niko
ed846c5baa
Update QueryClient.md (#1686) 2021-02-02 19:01:49 +01:00
Todd Matthews
5a28846d08
Update queries.md (#1716) 2021-02-02 18:59:30 +01:00
Arthur Budko
93f515c5d3
docs: fix links in initial-query-data.md (#1723) 2021-02-02 18:58:18 +01:00
Tanner Linsley
7bab9534cf docs: use sponsors iframe 2021-01-27 21:33:01 -07:00
Rene Dellefont
813d70f659
docs: add v2 docs links (#1676)
* docs: add v2 docs links

* revert (partial): docs: add v2 docs links

This partially reverts commit 48c40e387a - reverting docs Nav only.

* docs: add v2 docs link to home page banner.
2021-01-22 18:41:38 +01:00
Dominik Dorfmeister
39691a739b
feat: use tracked query (#1578) v3.6.0
* feat: useTrackedQuery

add useTrackedQuery hook, which tracks notifyOnChangeProps automatically via a Proxy

* feat: notifyOnChangeTracked

different approach to tracking used props by using an option rather than a new hook, so that we can also easily combine this with useInfiniteQuery; also, using Object.defineProperty rather than a Proxy

* feat: notifyOnChangeTracked

add some documentation for notifyOnChangeTracked

* feat: notifyOnChangeTracked

add a test for notifyOnChangeTracked

* feat: notifyOnChangeTracked

keep trackedProps separate from notifyOnChangeProps and only merge them in shouldNotifyListeners

* feat: notifyOnChangeTracked

store tracked result object on queryObserver instance so that the reference stays the same between renders

* feat: notifyOnChangeTracked

create a new trackedResult whenever we create a new result
this ensures that we keep referential identity of the tracked result object if nothing changes, but still get a new instance if we need to (to avoid stale closure problems)

* feat: notifyOnChangeTracked

add test for referential stability between re-renders; even if we are tracking changes, we should return the same object if we re-render (for some other reason than react-query changes) and nothing has changed

* feat: notifyOnChangeTracked

rename trackedResult to trackedCurrentResult

* feat: notifyOnChangeTracked

combine notifyOnChangeTracked with notifyOnChangeProps

* feat: notifyOnChangeTracked

remove auto-resetting of tracked props, which means that every prop ever tracked will lead to a re-render; this is the "safe" side - we'd rather have an unnecessary re-render rather than a bug because we are not re-rendering when something is observed only in an effect

* feat: notifyOnChangeTracked

always re-render if we are tracking props, but not using any. In that case, trackedProps will be an empty array, which would lead to no re-renders at all (same as setting notifyOnChangeProps to empty Array)

* feat: notifyOnChangeTracked

conditionally create trackedResult - we don't need it if we are not actually tracking props

* feat: notifyOnChangeTracked

add a test for combining notifyOnChangeProps: 'tracked' and notifyOnChangePropsExclusion

* feat: notifyOnChangeTracked

update docs
2021-01-22 05:05:47 -07:00
Dominik Dorfmeister
ead2e5dd52
fix(query): transition to error state when keepPreviousData is true (#1665)
closes #1659
2021-01-17 13:43:28 -07:00
Tanner Linsley
eb3d700dc5
fix(hydration): useMemo for hydrating again v3.5.16 2021-01-17 09:11:30 -07:00
Tim Crowter
c98968cc84
fix: stop returning cancelledError on reset during fetch (#1660) v3.5.15
* fix: stop returning cancelledError on reset during fetch

* test: stop returning cancelledError on reset during fetch
2021-01-16 10:53:57 -07:00
Melanie Seltzer
78a1e8a37e
docs: clarify setting cacheTime for persistWithLocalStorage to work properly (#1612) v3.5.14 2021-01-15 14:44:29 -07:00
Melanie Seltzer
e3f0ad58e8
fix: suppress SSR warnings for devtools (#1613) 2021-01-15 14:44:07 -07:00
Les Szklanny
5f046151e1
fix(hydration): useMemo -> useEffect (#1643) 2021-01-15 14:43:32 -07:00
Kristóf Poduszló
e9208b2401
fix(onlineManager): listen to 'offline' events (#1656) v3.5.13
Fixes #1654
2021-01-15 14:39:47 -07:00
JungHoonPark
2de2a0dc32
docs: describe exceptional behavior of onSuccess of useMutation.mutate (#1614) 2021-01-12 09:02:28 -07:00
Alexey Lizurchik
c01634659c
docs: fix guides references (#1615) 2021-01-12 09:01:38 -07:00
Jeremy Gabriele
dd574803d8
docs: fix typo in ssr guide (#1618) 2021-01-12 09:01:16 -07:00
HYUNSOL DO
87a59b0798
docs: Fix typos in dependent-queries.md (#1624)
Fix typo from 'achive' to 'achieve'. :)
2021-01-12 03:58:51 -07:00
Stephane Mensah
dd6c61d561
docs: mention query options strictly for useQuery (#1609) v3.5.12
* docs: mention query options strictly for useQuery

This is in accordance with issues faced when trying use certain query options in `prefetchQuery` and `prefetchInfiniteQuery`. I opened a [discussion](https://github.com/tannerlinsley/react-query/discussions/1596) and was [suggested](https://github.com/tannerlinsley/react-query/discussions/1596#discussioncomment-267856) to open a PR to mention/describe the options available.

* Update QueryClient.md

* docs: fixed link to `useQuery` in `QueryClient`

made changes as suggested in https://github.com/tannerlinsley/react-query/pull/1609#discussion_r554889518
2021-01-11 10:32:39 -07:00
Dmitry Petrov
5db686809e
docs: fix type (#1617) 2021-01-10 13:36:32 -07:00
Mariano Moreno Alvariza
b0c2f67952
docs: Update testing docs to match React Query V3 (#1610)
Updated ReactQueryCacheProvider with QueryClientProvider as current testing documentation does not work when using React Query V3
2021-01-09 13:33:30 -07:00
Niek Bosch
5c93a2ec3d
fix: prevent missing renders (#1608) 2021-01-09 13:31:50 -07:00
Pierre Hedkvist
ca947a62c2
docs: Update mutations.md (#1602)
Fix spelling in mutation page
2021-01-09 13:29:47 -07:00
Akibur Rahman
41f46ade10
docs: remove unnecessary parentheses (#1592) 2021-01-09 13:25:46 -07:00
Arthur Puyou
361935a12c
docs: fix typo on Initial Query Data page (#1565) 2021-01-07 08:59:31 +01:00
Marcos Bérgamo
f0ce8336cb
docs: fix misleading code example (#1566) 2021-01-07 08:59:05 +01:00
Marcos Bérgamo
57be6e602d
docs: fix misleading code example (#1567) 2021-01-07 08:58:33 +01:00
अभिनाश (Avinash)
18091feb79
docs: onMutate should be async (#1585)
Since we await in the function body, onMutate should be an async function.
2021-01-07 08:58:01 +01:00
Eric Chernuka
6b2bb21079
docs: Fixes incorrect prop variable in Todos example (#1590)
The prop referenced `completed` But the variable used was `todoId`.
2021-01-06 21:39:47 -07:00
Tanner Linsley
b756f563cb docs: update comparison 2021-01-06 13:28:55 -07:00
Tanner Linsley
f826edf0b5 docs: update comparison 2021-01-06 13:00:44 -07:00
Tanner Linsley
73add4bc35 docs: cleanup 2021-01-05 16:43:56 -07:00
Tanner Linsley
059f5220d8 Merge branch 'master' of https://github.com/tannerlinsley/react-query 2021-01-05 16:40:40 -07:00
Tanner Linsley
64b173ef7b docs: use page title for seo 2021-01-05 16:40:37 -07:00
Mike Lunn
6458c506ca
fix(devtools): Added type attribute to all button elements (#1581) v3.5.11
Adding type attribute tells browser what type of button it is. For most browsers the default type of button is submit. This causes a full page post back in older legacy server rendered frameworks like asp.net webfo
2021-01-05 15:51:42 -07:00
Tanner Linsley
a6c20112ec docs: update sponsor size 2021-01-05 13:14:35 -07:00
Tanner Linsley
b75000e4ca docs: do not adblock sponsors 2021-01-05 12:48:30 -07:00
Tanner Linsley
02edb22f10 docs: add axios dep 2021-01-05 12:41:03 -07:00
Tanner Linsley
1bea039661 docs: add deps 2021-01-05 12:16:58 -07:00