Category "react-redux"

Notistack enqueueSnackbar usage outside component

Is there any way to use enqueueSnackbar() outside the react component? For example, I want to show an alert on the service API request error. Api service reques

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

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

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