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

145
Views
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
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!