23,181 questions
-1 votes
0 answers
23 views
How to make Drawer Screens in Navigator appear dynamically in react native? [closed]
I am trying to make a Drawer Screen Tab appear dynamically according to a redux state value but this practice is not good as when I change the value of redux state, the whole component remounts ...
Best practices
0 votes
2 replies
53 views
React RTK Typescript: Using `ReturnType<AppStore['getState']>` vs `ReturnType<typeof store.getState>` when inferring RootState type
I've been reading up on React/Redux documentation, specifically on setting up types for the main redux application store, and was wondering if there are any significant differences when it comes to ...
-2 votes
0 answers
49 views
Component Re-mounts on redux state changed [closed]
As soon as I use dispatch to change a property of the object in redux state, suddenly the whole component re-mounts in react native. Below is a part of my Slice.tsx: const initialState = { ...
3 votes
1 answer
80 views
How do I pass data inside fetch function from createBrowserRouter to load content before page has loaded
I'm using react-persist in my application. When I click to add a product to my basket and then want to navigate to my basket page, how do I pass the basket data to the fetch function in the loader ...
-1 votes
1 answer
84 views
redux couldn't find store in react native 0.80
I have legacy application using vanilla redux and react-redux. I am facing this issue and unable to get root cause of this. Could not find "store" in either the context or props of "...
1 vote
2 answers
139 views
How to display msg received in API response on page?
I have one function which checks for user authorization export const authUser = (rideId, action) => { return (dispatch, getState) => { const postData = { consumer: "Rapi", ...
2 votes
1 answer
88 views
How to use parametrized queries in selectors?
I'm working on a React app with Redux-Toolkit (RTK) Query. I need to fetch accounts from the server and then render them as well derive some data from them through a chain of selectors. If I fetch ...
2 votes
2 answers
40 views
React-Redux ShopCart Application (Remove_from_cart)
I am currently working on a React-Redux based Cart app, and I am experiencing the following problem: When I continuously click the remove button in order to remove a product from my cart, the ...
1 vote
1 answer
48 views
How to preserve specific properties effectively when merging nested state in Redux?
In our reducer, we’re updating a nested array with new data coming from the backend. However, certain UI-specific properties (like tooltip) that are not part of the backend response need to be ...
0 votes
1 answer
328 views
Module '"redux"' has no exported member 'CombinedState'.ts(2305)
when I upgrade the redux version from 4.2.1 to 5.0.0, shows error: Module '"redux"' has no exported member 'CombinedState'.ts(2305) I have read the official release notes: https://github....
0 votes
2 answers
62 views
How can I create takeOne effect creator in Redux Saga?
I want a Redux Saga effect creator that only takes the first dispatched action of a pattern and ignores the rest. How can I create it? For example here Saga docs explains how takeEvery is created. I ...
-1 votes
1 answer
251 views
vi.spyOn(reactRedux, 'useDispatch') is not working / "TypeError: Cannot redefine property: useDispatch"
I don't seem to find a solution for the below code / test to work (I went through a lot of articles and stackOverflow...). Various solutions provided by chatGPT are useless as well. I also see people ...
0 votes
1 answer
89 views
Redux State Sharing in Microfrontend Architecture | 1 host, 1 remote example
I have currently a host - container and a remote - dashboard. I have a full blown redux+saga setup at my container, which I am exposing to remote using Module federation as well. plugins: [ new ...
3 votes
2 answers
78 views
Can I use a variable index in a useSelector call?
Suppose I have a long list of playerData in my redux store, and some players' data gets updated very often. Let's say I have a Player component and inside of it I want to access that player's specific ...
0 votes
0 answers
100 views
How to Maintain Dynamic RTK Query Tag Validation and Invalidation for Multiple API Slices in Redux Toolkit?
I'm working on a project using Redux Toolkit (RTK) Query to manage multiple API endpoints, where each API slice is constructed dynamically through a function. My goal is to maintain a dynamic approach ...