Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

232
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!