* feat(devtools): update react query logo to close devtools
added button wrapper on react query logo which onClick closes devtools window
closes#3067
* feat(devtools): update test case for open and close devtools
there is no need to re-run the select function if it is referentially stable, even when it throws an error. if no dependency has changed, we can re-use the cached error, as the select function should be idempotent and thus return the same error anyway.
further, if we have cached data from a previously successful select, that should be returned as `data` alongside the error.
- [react-native-appstate-hook](https://github.com/amrlabib/react-native-appstate-hook) is not updated regularly. It currently has a `peerDependencies` problem for React 17 and 18.
- It actually does the same thing with `AppState.addEventListener('change', ...)` when you only specify `onChange` property on `useAppState()`.
* expose errorUpdateCount on useQuery
* refactored test slightly
* Update docs/src/pages/reference/useQuery.md
as suggested
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* removed the first click as we fetch on default,
* prettier
* added errorUpdateCount to failed tests.
* prettier
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* feat(query): functions for refetchOn options
make refetchOn mount/reconnect/windowFocus also accept a function that gets evaluated on the fly with the current data and query
* feat(query): functions for refetchOn options
docs
* feat(query): functions for refetchOn options
tests
* feat(query): functions for refetchOn options
only pass query to the functions as they don't lean towards error or data
* feat(query): functions for refetchOn options
fix docs
* feat(query): functions for refetchOn options
fix docs
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
* 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>
* 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>
* 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
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.
* 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>
* 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>