All Questions
14 questions
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
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 ...
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: ...
3
votes
0
answers
309
views
How to change baseQuery redux when language changing with i18n?
I need to change baseQuery when AsyncSorage variable changing or i18n language changing (this the same thing).
This code works, but it doesn't change dynamically. I need to reload app and language are ...
0
votes
1
answer
448
views
Unable To Trigger Invalidate Cache in rtk query using tags
This is my Api.js
export const api = createApi({
reducerPath: 'api',
baseQuery: fetchBaseQuery({
prepareHeaders: (headers, { getState }) => {
const userInfo=JSON.parse(localStorage....
0
votes
1
answer
155
views
TypeError: Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method
I am trying to trigger a rtk query end point from a function
const [getcitycode, { isLoading, error, data, isSuccess, isError }] = useLocationQuery();
const getLocationDetails = async () => {
...
0
votes
2
answers
586
views
How can I unsubscribe from Firebase onSnapShot in an RTK Query?
I'm creating an app in React Native that depends on realtime updates. When a user updates the data in their session, another user needs to immediately see that update without refreshing their app. I'...
0
votes
0
answers
344
views
Is there a way to use RTK query hooks like loading , success , error multiple times in a same component
Edit Profile Feature: I Have a Component Where i get profile data from server and i display it in input fields then edit data send new data to server.
const {data,isLoading,isFetching,error,isError,...
0
votes
1
answer
1k
views
React Native access token expiration/renewal upon 403 response code from a RTK Query API
I am calling an API defined using RTK Query, within a React Native + Redux Toolkit + Expo app. This is secured with an authentication / authorization system in place i.e. access token (short ...
0
votes
0
answers
210
views
RTK query useQuery invalidateTags on infinity scroll
I have this function that basically helps me implement infinite scroll everywhere. Still, I faced a problem where when I invalidate a tag related to an endless scroll tag it doesn't update the needed ...
11
votes
2
answers
19k
views
Invalid hook call while testing with jest - react native
I've got problem with testing screen. I'm trying to test with jest snapshot but first of all I wan't to pass simple test with RTK Query request API. In next example I try to get error something like ...
1
vote
1
answer
4k
views
How to use manual cache updates using RTK Query
I have recently started working on redux toolkit, Basically i want to refetch the data from database if there is mutation. I am using flatlist in my react native project where on pull to refresh i ...
3
votes
2
answers
5k
views
Reat Native & RTK Query - Call an other endpoint when request is success
I am new in Redux & RTK Query and I do not understand how I can fetch data from another endpoint when response of another endpoint is succeed.
I created an API like that:
import { Config } from '@/...