Category "redux"

React Redux Problem: How to call multiple api in your react component with React Redux Toolkit RTK queries?

Hope you all are doing fine. RTK queries return response in data attribute which can be accessed via hook generated by RTK My Code: const {data = [], isFetching

Persist-reducer function giving type error to my reducer in typescript

I am trying to configure react-persist in my typescript react application. The persistReducer function is giving a type error to my reducer that Argument of typ

One component affecting another in reactjs

Every url loads three main components: Left panel, center and right panel. In right panel, we have a button which returns a sub-component CreateForm inside the

An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft

I understand this has been asked before but so far no answers except someone making a syntax mistake. I have verified this against every tutorial I've seen onli

cant access state, react redux

I have a page with notes for a specific user, the problem is when i'm trying to access the state of 'my notes' i get 'undefined' on console, in postman, everyth

How to use redux in Next.js?

I am new to Next.js, So I follow some tutorials for Redux integration in Next.js. All is working fine but whenever I switch between pages, each time API make a

Cannot update a component while rendering a different component warning

I am getting this warning in react: index.js:1 Warning: Cannot update a component (`ConnectFunction`) while rendering a different component (`Register`). To l

Error: Request failed with status code 500 but it works after I refresh the page

When I run my Next.Js/MongoDB Project for the first time it always greets me with a "Error: Request failed with status code 500", but after I refresh the page i

Client side state is not hydrated from server on page reload

The client-side state is not hydrated from the server after creating a new store CodeSandBox Link - https://codesandbox.io/s/vibrant-aryabhata-l29r2b Steps to r

React native install redux and socket.io?

I am new to react native and I have downloaded a project from github, and I see redux and socket.io in the package.json file, is there any need to install them

What's hydrate action in Next Redux Wrapper?

Recently I started using Next.js and I have a question about the next-redux-wrapper package. I don't really understand the HYDRATE action. So I wonder concretel

useSelector doesn't update value in Next.js

I have a problem, createAsyncThunk function makes request to server (axios) and then get data, after that extraReducers handle builder.addCase in it and makes s

How to use createAsyncThunk with Typescript? How to set types for the `pending` and `rejected` payloads?

Right now I've got these actions that I use for an upload thunk's lifecycle. type UPLOAD_START = PayloadAction<void> type UPLOAD_SUCCESS = PayloadAction

Uncaught TypeError: dispatcher.useSyncExternalStore is not a function

i am trying to change the state of bulma model using useSelector and useDispatch like this const isState = useSelector((state) => state.isActiveState

I would like to persist add in store without reducer. However, I am not sure how to setup my store accordingly with this

const store = createStore( rootReducers, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() ); let persistor = persistSt

How can I view network requests (for debugging) in React Native on Windows?

I found a lot of answers on this topic example but they were all about Mac Os, I would like to view my network requests in React Native to help me debug Windows

Using the Context API as a way of mimicking useSelector and useDispatch with redux v5

I'm working on a React project where I'm constrained to using React Redux v5, which doesn't include useDispatch and useSelector. Nonetheless I really would like

After updating to the latest Redux Dev Tools extension I am getting: "Symbol.observable as defined by Redux and Redux DevTools do not match."

For some unknown issue after getting the latest update from the redux dev tools chrome extension I am getting the below warning message: Symbol.observable as d

Adding a payload to createAction function using reduxjs/toolkit

How do i add a payload to createAction from the now function? convert from this: import { ADD_ARTICLE } from "../constants/actions-type" import { createAction }

Merge my initial state with data from API

I don't understand why my state data was not merged with my initial state In my initial state i have: data: {role: null, lastUrl: null}, When my call api is ove