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

212
Views
JSX está analizando antes de devolver los datos de una función en reaccionar Js

Estoy llamando a una función del método de procesamiento para obtener los datos actualizados como este. pero no obtengo los datos en la página porque antes de obtener los datos mi jsx está analizando. Aquí está mi código

 private fetchMessages = async () => { const isArray = Array.isArray(this.props.messages); let messagesData: any; console.log(this.props.messages); messagesData = this.props.messages; if (!isArray) { const result = await this.props.messages.fetchByOffset({ offset: null, }); const results = result.results; messagesData = results.map((value: any) => { return value.data; }); } return await messagesData;

};

en la función de render estoy llamando así

 private getData() { this.fetchMessages().then(messageResponse => { this.jetMessages = this.processCustomMessageArray(messageResponse); return new ArrayDataProvider<null, ojMessage.Message>(this.jetMessages); }); return null;

}

 render(props: Readonly<Props>): ComponentChild { this.jetMessagesDataprovider = this.getData(); return ( <div id={`${this.uid}_stickycontainer`} class="oj-sp-messages-banner-sticky-container" > <oj-messages id={`${this.uid}_messagecontainer`} messages={this.jetMessagesDataprovider} displayOptions={this.computedCategoryOption} > <template slot="messageTemplate" render={this.renderMessage} /> </oj-messages> </div> ); }
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!