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

254
Vistas
Get error: warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application

I have code something like this:

componentDidMount() {
    const { account, columns } = this.state;

    getDependencies(this.context.contextPath, account, columns ).then(response => {
      const updated = response.columns;
      const newDimensions = updated.filter(
        ({ dimensionId: id1 }) =>
          !columns.some(
            ({ dimensionId: id2 }) =>
              id2 === id1
          )
      );

      let temp = columns.concat(newDimensions);
      temp = _.sortBy(temp, ['orderNo']);

      this.setState(
        {
          allowedPostingDimensions: response.allowedDimensions,
          columns: temp,
          account: response.glAccount,
          isDependenciesLoaded: true,
        }, this.handleItemChange
      );
    });
  }

And after sorting the columns I get error and setting I get this error:

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.

If I don't sort columns (just add new columns) I will not get this errors.

I already have tried to create flag in state: isMounted: false. In componentDidMount set state isMounted = true and in componentWillUnmount: set state isMounted = false. This is not help to me.

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