Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

149
Vistas
Is there any way I can update a mounted React node's props in my current setup?

So I have a mounted React application that is rendered like this (it's via another framework on top):

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

On top level, I call:

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;
}
});

In essence, when the EXT component loads, I insert React into the page. So what I can do is onServerSuccess (when I receive the data I want), I can use this.root.unmount() and mount the component again. However, mounting and unmounting repeatedly is not really the best solution. What I'm trying to do is perhaps to make this.myProps "reactive" so whenever they change, the component knows and re-renders without having to be unmounted and re-mounted again.

Maybe there's a better solution out there?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda