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

143
Views
¿Hay alguna forma de actualizar los accesorios de un nodo React montado en mi configuración actual?

Así que tengo una aplicación React montada que se representa así (es a través de otro marco en la parte superior):

 const componentRender = (entryComponent, initialProps, targetNode) => { const root = createRoot(targetNode); const element = createElement(entryComponent, initialProps); const wrapper = createElement(SomeWrapper, null, element); root.render(wrapper); }

En el nivel superior, llamo:

 Ext.extend(Ext.Container, { listeners: { afterrender: function () { this.root = componentRender( MyComponent, this.myProps, domElement ); }, }, constructor: function (...args) { Object.assign(this, args); }, onServerSuccess: function(data) { // here is where I receive new data this.myProps = data; } });

En esencia, cuando se carga el componente EXT, inserto React en la página. Entonces, lo que puedo hacer es onServerSuccess (cuando recibo los datos que quiero), puedo usar this.root.unmount() y volver a montar el componente. Sin embargo, montar y desmontar repetidamente no es realmente la mejor solución. Lo que estoy tratando de hacer es quizás hacer que this.myProps sea "reactivo" para que cada vez que cambien, el componente sepa y se vuelva a renderizar sin tener que desmontarlo y volver a montarlo.

Tal vez hay una mejor solución por ahí?

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!