35,526 questions
-5
votes
0
answers
56
views
How to handle a batch of Redux like updates which the later update rely on the formers in React.js state cycle?
I beg your understanding for my poor English. I am designing an organization structure management system. A tree ( react-arborist) is used to express the departments, staff and their relations. User ...
-3
votes
0
answers
40
views
Redux state not updating in React component after dispatching action [closed]
I’m building a React project with Redux for state management. I have an action that updates the state, but my component doesn’t reflect the updated state even after dispatching the action.
Code (slice ...
2
votes
1
answer
88
views
Solving conflicting react router redirects
I am working on a basic app with React, Redux and React Router 7. This app has a /profile route which is protected. If you go on a protected route without being logged in, you are redirected to /...
3
votes
1
answer
62
views
Custom use API Hook Error: Could not find react-redux context value; please ensure the component is wrapped in a <Provider>
I'm trying to learn how to use react-testing-library and having trouble getting started with some of my components. I keep receiving the error in the title, pointing at custom API hooks in the file.
...
Best practices
0
votes
2
replies
68
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 ...
0
votes
2
answers
219
views
Redux vs. Zod: Clarifying their Roles in Modern React State Management [closed]
I'm working on a React application and am trying to understand the fundamental difference between Redux and Zod. I've seen both mentioned in discussions about managing state, and I'm confused about ...
0
votes
1
answer
145
views
How to handle API error with a manual retry button without triggering infinite refetches?
I’m using RTK Query in a React component to fetch users:
function MyComponent() {
const {
data, isLoading, isError, isSuccess,
} = useGetUsersQuery();
if (isLoading) {
return <div&...
0
votes
0
answers
104
views
The request is frozen on the, {status: “pending”, isLoading: true, data: undefined}
The request is frozen on the pending status, the loading status does not change in the component {status: “pending”, isLoading: true, data: undefined}, I see the response in devTools and in my API, ...
-1
votes
1
answer
92
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 "...
0
votes
1
answer
118
views
TypeError: Can not read property 'store' of undefined, react-native 0.79.2
I'm encountering the following issue on Android after upgrading my React Native project to version 0.79.2. This error does not occur on iOS, which makes it harder to trace since the same codebase ...
1
vote
1
answer
59
views
Problem with accessing stale Redux state in event handlers
I have a SignalR (WebSocket) server for a game, and a React/Redux client that connects to it. I have a component whose task is to listen to SignalR messages to handle them, which usually involves ...
1
vote
2
answers
144
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",
...
0
votes
0
answers
51
views
Propagate generic parameters through `react-redux` `connect`
Consider the following, where I have a component that has a generic type parameter used as the parameter argument of a callback property:
import { render } from '@testing-library/react-native';
import ...
2
votes
2
answers
42
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
votes
1
answer
67
views
redux thunk pattern composing middleware calls
I'm sure this has been asked and answered, but maybe I'm not able to phrase it correctly to find the right results.
Say I have two redux middleware operations:
a call to create an asset entity in the ...