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

163
Views
React muestra datos incorrectos. Supongo que simplemente no se actualiza

React muestra datos incorrectos. Supongo que simplemente no se actualiza. No puedo resolver este problema durante 2 días. Ayuda por favor. ¿Que esta mal aquí? Traté de arreglar el componente no se montó, pero desafortunadamente no funcionó.

 class Table extends React.Component { constructor(props) { super(props); this.state = {data: []} } componentDidMount() { this.data = setInterval(() => console.log(this.setState({data})), this.setState( fetch('/lk/reports/3/month-ajax') .then(response => response.json()) .then(data => this.setState({data}))) , 50); } componentWillUnmount() { clearInterval(this.data); } render() { if (this.state.data.length == 0) { return (<div className="table-wrapper mt-5 d-flex justify-content-center"> <i className="fas fa-spinner fa-3x fa-fw fa-spin"></i> </div>); } else { return ( <table className="table highlight responsive-table"> <thead className="teal lighten-4"> <tr> <th>{this.state.data.time}</th> </tr> </thead> <tbody> {this.state.data.kpi.map(item => <tr className={this.activeRow(item)}> <td>{item.client}</td> <td>{item.all_incidents}</td> </tr>)} </tbody> </table> ); } } }

Aquí está el código completo de react.js ¡Gracias!

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!