All Questions
Tagged with rtk-query react-native
79 questions
-1
votes
1
answer
59
views
+100
The API does not work after clearing the cache on Andriod [closed]
I am developing an application in React Native v.0.78.0 using RTK query for back queries. Previously, everything worked fine, but not so long ago I discovered that after clearing the application cache ...
0
votes
0
answers
301
views
Why RTK Query's createApi produces "all 3 hooks need to be provided" error?
I have been working on a redux+ React Native legacy project, hundreds of reducers. I want to implement RTK query. I have written a very simple test example already integrated in the main project.
By ...
0
votes
0
answers
321
views
onQueryStarted RTK Query triggers twice
Context
I have getGroupList API. It's called in 3 screens with different parameters. So I'm creating 3 cache entries. It's a requirement.
On the other hand, I have the deleteGroupUser API basically ...
0
votes
2
answers
643
views
redux toolkit query,unable to return value with with transformResponse using queryFn
I would like to modify the response received from the backend with the transformResponse function but I get an error even when I only return the first argument ""baseQueryReturnValue"&...
1
vote
1
answer
449
views
React Native with RTK Query Pagination issue
I have a React Native mobile application where I'm trying to manage API requests with RTK Query. On the 'Products' screen, I fetch and display data using getProducts (infinite scroll). On the ...
0
votes
1
answer
874
views
FlatList onEndReached not working properly
I have a simple component with list of Cards, what I want to do is also simple which is infinite scrolling, so that when I reach almost the end to just increment the page by 1 and call my API ( using ...
2
votes
1
answer
44
views
How to prevent form processing in react native
I have a couple of screens in my react native app which display search forms and the list of results. I'd like them to only run the search when the submit button is clicked, but currently the search ...
0
votes
1
answer
2k
views
How to abort/cancel/ignore previous query result if new query was sent Redux Toolkit Query [duplicate]
So I have such issue, user has 3 options to choose from and when he chooses one, request is sent to backend, which updates the status and sends it back, Im also updating local state when sending the ...
0
votes
1
answer
375
views
How to reset the page state in React Native with RTK Query
I'm working on a React Native project that uses RTK Query to fetch dynamic products from the DB. I implemented Infinite scroll functionality using the merge, serializeQueryArgs, and forceRefetch ...
0
votes
0
answers
649
views
Setting up rtk query with react native
I am incorporating Redux Toolkit Query (RTKQ) for state and API management. All I'm trying to do is register a user onClick via the register user component:
const RegisterScreen = () => {
const [...
2
votes
1
answer
775
views
How to throw Error to RTK Query useQuery() hook from onCacheEntryAdded lifecycle callback
I would like to indicate that socket disconnected by throwing an error to useQuery() hook so the error is accessible from "error" here:
const [query, { isSuccess, data, error }] = useQuery()
...
2
votes
1
answer
865
views
React Native Redux RTK Query returns null reponse. Similar solution works with Fetch API
First, I have implemented my solution with Fetch API which I have tested and it works. Then I came across Redux RTK Query and wanted to give it a try, but I get null as a response:
LOG response
LOG ...
0
votes
0
answers
274
views
RTK query - Query lazyload and cache data append problem
I'm facing problem while trying to append a cached data with a new data in rtk query. The api is paginated and I want to append the data with the previous data.
If I hardcode the query
loadPosts: ...
1
vote
0
answers
796
views
RTK Query useQuery hook: Error is not the value returned in transformErrorResponse
I have an endpoint with a query that has a transformErrorResponse applied to it where I return custom error objects.
export const myAPI = createApi({
reducerPath: 'myAPI',
baseQuery: ...
1
vote
0
answers
499
views
RTK query how to reset the params of the API when I invalidate during mutation
I am using RTK query in my react-native app, and I have a List of Home Posts and List of user posts and each has a skip param that is increment onEndReached
I have a mutation fn deletePost that when ...