Category "redux"

retrieve store data from react redux

I'm new to redux, I can't get data from the store.I get this message in the console: Error: Invalid hook call. Hooks can only be called inside of the body of a

(react redux toolkit) i want to know using action with multiple prameters

i recently started @reduxjs / toolkit. when i see code or documents of this, it not is not worked (undefined...) or too complicated(prepare?? createaciton??). i

Should I use Redux or Redux-Toolkit? [closed]

I am new in studying Redux. Then I know the existence about Redux-toolkit. My question is which should I use? Can Redux-toolkit replace Redux

Redux -Having a 404 errror and state.category.push(action.payload) not a function error

I'm getting a 400 client error and saying state.category.push is not a function and the current state is pending. I will be happy if someone helps me out on thi

You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0). We no longer support global installation of Create React App

C:\Users\lg\Desktop> npm uninstall -g create-react-app up to date, audited 1 package in 216ms found 0 vulnerabilities C:\Users\lg\Desktop>npx clear-npx

You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0). We no longer support global installation of Create React App

C:\Users\lg\Desktop> npm uninstall -g create-react-app up to date, audited 1 package in 216ms found 0 vulnerabilities C:\Users\lg\Desktop>npx clear-npx

How to run async call on a reducer?

import { createSlice, PayloadAction } from "@reduxjs/toolkit" import { Dispatch } from 'redux'; import axios from "axios" const API_URL = process.env.REACT_APP_

How can I link certain actions between 2 Redux stores?

I've got a situation whereby I wish to "link" a portion 2 Redux stores together (I know this is unusual), but I can't work out how to filter the actions appropr

React.js: How to get and show current user when logged in?

In my React app I am working in user login. My goal is to show current user's username when the user is logged in. I'm fetching the user data in redux actions a

React.js: How to get and show current user when logged in?

In my React app I am working in user login. My goal is to show current user's username when the user is logged in. I'm fetching the user data in redux actions a

Optimistic updates for item create in RTK Query

Can't figure out how to get optimistic updates to work properly when I'm creating a new item rather than updating the existing one. The optimistic updates do wo

reduxtoolkit mocking store with typescript

I found this code from redux documentation // test-utils.jsx import React from 'react' import { render as rtlRender } from '@testing-library/react' import { con

Store redux data that can be accessible with swift and java

I want to rewrite my React Native application with Java for Android and Swift for iOS. The thing is, I don't want to lose application data so that the user has

What is wrong with my reselect function ? I dont get an output

I want to use reselect. I want to get my shopping cart by the ids. reselect.ts import { createSelector } from "reselect"; import { RootState } from "../store";

Redux toolkit: Uncaught TypeError: Cannot read properties of undefined (reading 'type')

I get the following error when I add a specific action in the extraReducers inside a slice: Uncaught TypeError: Cannot read properties of undefined (reading 'ty

How to fix circular dependencies of slices with the RootState?

I recently started using redux-toolkit and started writing my reducers using the createSlice following their docs. One reducer, let's call it reducerA, imports

How to remove an item from Local Storage when clicking on it? [duplicate]

I want to delete an item stored in Local Storage when it is clicked. But I don't know how to do that. Please help me to solve this problem. Th

How to fix 'The previous state received by the reducer...'?

I load/update data in localStorage: import thunk from "redux-thunk"; import {applyMiddleware, createStore} from "redux"; import {composeWithDevTools} from "redu

React Material Table : onRowAdd not refreshing

I am using Material Table for displaying table data. Using onRowAdd, I am able to add a new row but the page is not refershing. It reloads and get stuck then I

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