Category "redux"

Modify Redux Persist settings after applied to store?

There are any way to modify settings on redux-persist after applied to store? or this can be only defined at bootstrap of application?

React/Redux Testing - Could not find "store" in either the context or props

I'm new to react/redux and just getting into testing my first app with chai. I'm using redux-form/immutable and react-router, and I'm not sure how to resolve th

Why do we need middleware for async flow in Redux?

According to the docs, "Without middleware, Redux store only supports synchronous data flow". I don't understand why this is the case. Why can't the container c

Read Store's Initial State in Redux Reducer

Initial state in a Redux app can be set in two ways: pass it as the second argument to createStore (docs link) pass it as the first argument to your (sub-)redu

How to avoid warning: Outer scope values like 'userDTO' aren't valid dependencies because mutating them doesn't re-render the component

getTransactions method call need to be called only if user is logged in, but the info about the user will not be visible. What can I do to force a reload when o

How to use socketio inside controllers?

I have a application created with Reactjs,Redux,Nodejs,MongoDB. I have created socketio in backend side. server.js const express = require('express'); const mo

How can I keep my useSelector() variable from a redux store updated after each dispatch?(Redux Toolkit)

So I'm using React Native with Redux Toolkit and I'm facing this issue where once I dispatch and decrement a store value, the variable inside the component that

How can I use redux and graphql with apollo client in the same react app?

I'm working on a project, and I'm using apollo/client, graphql in react, and for the global state management, I have to use redux. I'm quite sure I'll have to h

React router, redux, electron: router isn't rendering

I'm trying to get react-router to work in an electron app. I'm using a boilerplate and stripped away some of the stuff I don't want but that should provide a pr

Set default header for every fetch() request

Is it possible, using the fetch API, to set default headers for every single request? What I want to do is set an Authorization header whenever there is a json

Uncaught Invariant Violation: Too many re-renders. React limits the number of renders to prevent an infinite loop

I'm trying to add a snackBar in order to display a message whenever a user signIn or not. SnackBar.jsx: import React from "react"; import PropTypes from "prop-

Dispatch actions with Redux Toolkit requires two arguments

Using Redux Toolkit, I'm trying to dispatch an action without context of event or etc., so I get the following error: error TS2554: Expected 2 arguments, but g

How to do nested conditional rendering in React?

A situation I have not ran into before due to way roles/authentication work in a project I am working on. On login, the code returns whether the user is just a

Failed prop type: Invalid prop `errors` of type `string` supplied to `CreateProfile`, expected `object`

I am trying to create a profile for a user on login, after submitting the form I am getting the error as invalid props errors. As both my client and serv

Using ES6 Map with React and/or Redux

I am looking at using the ES6 Map object to do my hashing for me, instead of creating a custom hashing function. However, it seems to me that it doesn't have mu

How to create an admin route and another private route for registered users with a normal route?

I have used this code as the private route, but I want a another separate route only for admins. How can I change the code? import React from 'react'; import {

Receiving "Attempted import error:" in react app

I am receiving the following error when trying to run my React app: ./src/components/App/App.js Attempted import error: 'combineReducers' is not export

Using redux with redux-persist with server-side rendering

I am trying to implement redux 4.0.0 with redux-persist 5.10.0 in an SSR application and am running into an issue where I cannot properly supply createStore() w

TypeError: Cannot destructure property 'name' of 'item' as it is undefined

** I can't figure out the problem here. Can anyone help me please ** When I pass item as props I got TypeError: Cannot destructure property 'name' of 'item' as

React SSR blinks when starting client

simplifying my post: my ssr webpage blinks when starting client which means page renders server side rendered html then goes blank and then it starts loading e