Category "redux"

Redux Toolkit: can I use createAsycThunk with Firebase listener functions (e.g. firestore.collection.onSnapshot)

Is there a way to use createAsyncThunk with Firebase listeners, for example firestore.collection.onSnapshot? It may not work because the way onSnapshot works (i

How can I dispatch an action using useEffect in main app.js?

I want to dispatch an action whenever any page or component of my app loads. So what I am trying to do is to dispatch the action using store.dispatch inside use

Streaming updates with RTK-Query mutation and updating cache

I'm using sockets to allow users to send messages in real-time. I read the RTK-Query documentation and saw an example for a query, where I would be fetching dat

Why does ngrx/store example app use multiple stores? (how to design store)

I am trying to make a rather big, scalable application and I was told it is best practice to have one single store storing the current global state (including b

redux-persist is not saving my redux state when I refresh or close my react-native app

My react-native app is not saving my data using redux toolkit, redux-persist and asyncstorage import AsyncStorage from '@react-native-async-storage/async-storag

Why ESC generator in Redux Saga waits for promise to be fulfilled?

I am reading Redux Saga instruction docs as the below link: https://redux-saga.js.org/docs/introduction/BeginnerTutorial/ In the code in sagas.js, incrementAsyn

How do I add an element to array in reducer of React native redux?

How do I add elements in my array arr[] of redux state in reducer? I am doing this- import {ADD_ITEM} from '../Actions/UserActions' const initialUserState = {

Redux-toolkit multiple AsyncThunk at one slice

What is the best approach to manage multiple AsyncThunk at single slice. Would be correct if I put computed properties of each async action? export const regist

What does this render method do: const {images, selectedImage} = this.state;?

I'm doing a simple tutorial on react/ redux and I do not understand why we have to, in the render() method, do const {images, selectedImage} = this.state;

React DatePicker how to open datepicker on click of icon

Trying to open datepicker on click of icon of react-datepicker component, I have gone through their docs and issues links but found that its not much useful. &

Why componentDidMount gets called multiple times in react.js & redux?

I read componentDidMount gets called only once for initial rendering but I'm seeing it's getting rendered multiple times. It seems I created a recursive loop.

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined raised when starting react app

I'm working on a project in React and ran into a problem that has me stumped. Whenever I run yarn start I get this error: TypeError [ERR_INVALID_ARG_TYPE]

React-Redux and Websockets with socket.io

I'm new with that technology React-Redux and I would like your help with some implementation. I want to implement one chat application with sockets (socket.io)

How to get an item from redux store with redux saga

So I have fetched the data from an API and stored it into my Redux store. It's an array of objects, containing 100ish objects. On the front end I am displaying

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