Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

281
Vistas
You may not call store.getState() while the reducer is executing...(Its not about redux-devtools extension)

LoginModal.jsx

import ...

  const [burgerAnimation, setBurgerAnimation] = useState(false);
  const handleBurgerAnimation = () => {
    setBurgerAnimation(!burgerAnimation);
  };

userSlice.js

import { createSlice, createAsyncThunk } from "@reduxjs/toolkit";
import LoginService from "../../Services/Login.service";

export const userSubmit = createAsyncThunk("user/submit", async (params) => {
  try {
    const { submitFunc, submitForm, dispatch, closeModal, navigate, handleBurgerAnimation } = params;
    const { data } = await submitFunc(submitForm);
    dispatch(handleError(null)); // clear error message after
    closeModal();
    navigate("/");

    return {data, handleBurgerAnimation};
  } catch (error) {
    const { dispatch } = params;
    const errorMessage = error.response.data.message;
    dispatch(handleError(errorMessage));
    dispatch(handleStatus("idle"))
  }
});

export const userLogout = createAsyncThunk(...);

export const userRefreshAccessToken = createAsyncThunk(...);

const initialState = {
  userData: {},
  errorResponse: null,
  status: "idle",
};

export const userSlice = createSlice({
  name: "user",
  initialState,
  reducers: {...},
  extraReducers: {
    [userSubmit.pending]: (state, action) => {...},
    [userSubmit.fulfilled]: (state, action) => {

      const {data, handleBurgerAnimation} = action.payload;
      if (data) {
        state.status = "succeeded";
        state.userData = data;
        localStorage.setItem("user", JSON.stringify(action.payload));
        handleBurgerAnimation();
      }
    },
    [userSubmit.error]: (state, action) => {...},
    [userRefreshAccessToken.fulfilled]: (state, action) => {...}
  },
});

export ...

Hi all.I try to close navbar menu in mobile web when user login but when i try to do that i get this error.If i dont use handleBurgerAnimation function in [userSubmit.fulfilled] i dont get this error.What is the reason i cant use handleBurgerAnimation function in extrareducer ? Finally i would appreciate if you could give feedback about my project. Repo : https://github.com/UmutPalabiyik/mook

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda