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

211
Views
react-grid layout: Warning Can't call setState on a component that is not yet mounted

What I am trying to do is, have multiple buttons to create different elements. The title is the error message that appear in my console when i run my app.

This is my codesandbox link that shows the code and error. Click on the link and open the console, the error is there

create chart function

 onChartItem() {
    /*eslint no-console: 0*/
    console.log("adding", "n" + this.state.newCounter);
    this.setState({
      // Add a new item. It must have a unique key!
      charts: this.state.charts.concat({
        i: "n" + this.state.newCounter,
        x: (this.state.charts.length * 2) % (this.state.cols || 12),
        y: Infinity, // puts it at the bottom
        w: 8,
        h: 6
      }),
      // Increment the counter to ensure key is always unique.
      newCounter: this.state.newCounter + 1
    });
  }

any advice is appreciated

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I change this.onChartItem = this.onChartItem(this); to this this.onChartItem = this.onChartItem.bind(this);

about 4 years ago · Juan Pablo Isaza Report
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!