Category "react-redux"

Redux-persist does not work with Redux-Toolkit

The app works fine The only thing is that redux persist is not working as it should.Persist doest not persist anything,it does not give any errors in the consol

React Navigation v5: How to navigate using redux thunk/redux saga?

How can I navigate the screen in react-navigation in Redux-Saga and Redux-Thunk? Is it possible to get access to the navigation context in sagas or thunk? For e

Upload Image with Axios Post request

I am trying to make a post request to an api to upload a user image and send it to the api for profile settings.But i always receive "the image field is require

Client-side jwt token storage

I need advice, what is the best way to store a JWT token? Should we store in cookies or storages? But with the CSRF flaw and xss attacks I have a doubt. I'm sti

Getting VS Code to detect React props properly when Redux state props are mixed in

There is a nice example in the React-Redux documentation on how to build a functional component that will receive both props from Redux and from its parent comp

Trying to get React Redux example in TypeScript to play well with VS Code

In the Redux documentation, there is an example that is not playing well with VS Code. I am talking about the example here: https://redux.js.org/usage/usage-wit

Redux store takes lil bit time to update store which causes else block to execute and hence get redirected to unintended page

//PrivateAuthComponent.js import React, { useEffect, useState } from "react"; import { useSelector } from "react-redux"; import { useRouter } from "next/router"

Using react dev tools inside iframe [In Chrome]

When react app is inside an iframe, dev tool chrome extension for react is not working. Refererd: https://github.com/facebook/react/issues/18945 Solution sugges

useSelector returns undefined - react-redux

I'm using react-redux. createSlice: import { createSlice } from "@reduxjs/toolkit"; const datatableSlice = createSlice({ name: "datatable", initialStat

How do I correctly implement Redux Saga action dispatches?

I'm currently playing around with redux saga and I'm having troubles implementing it correctly. Let's say I have a reducer which keeps track of how many times t

Unable to mock react-redux hooks after migrating to 8

I have been using the following pattern to mock react-redux hooks in tests that use Enzyme shallow rendering: import * as redux from "react-readux"; ... jest.sp

TypeError: undefined is not an object (evaluating 'state.selectedData.push') - Can't add payload to state using Redux Toolkit

I'm having an issue using Redux Toolkit. I want to push an object to my initial state called selectedData which is an array, this gives me the error "TypeError:

react reducer toolkit dispatch not working

I wrote profile page I want to get profile datas from api but my dispatch not working, in getProfileDetails function dispatch not working. import {createSlice}

how to know if i should use redux for my application or any other alternative?

I am new to react native and mobile development world. I am developing a mobile application with react native, it's basically an entreprise management app for H

Argument of type 'AsyncThunkAction<any, void, {}>' is not assignable to parameter of type 'AnyAction'

store.ts export const store = configureStore({ reducer: { auth: authReducer }, middleware: [], }); export type AppDispatch = typeof store.d

React causing: Can't perform a React state update on an unmounted component

My situation: After login I try to get username and save it to redux store after this redirect from login to home page(in this page I display list of tasks) and

does redux change the reference of rootState object when a field's value in a sub state changes?

i have my redux states setup like this rootState subState1 field1 field2 subState2 field1 field2 multiple sub

Is there a way to overcome 401 unauthorized error in React, while trying to access data from Rapidapi.com?

I am facing the problem of unauthorized 401. Done everything mentally possible, so posting it here with code and result pics. The data when accessed like this r

How can I merge multiple reducers?

I have a file structure like below store index.js reducers organize index.js user index.js index.js trying to combine organize and user reducers to reducers/

React State update with button click from another component

Please read the details below of code enter image description here This MegaMenu Component import MenuIcon from '@mui/icons-material/Menu'; import './MegaMenu.c