Hi
I was curious to understand why you implemented this with a javascript while loop and a promise, where you can also use the ReactJS event componentDidMount on the specific OutSystems widget and an event handler.
https://www.codingame.com/playgrounds/8747/react-lifecycle-methods-render-and-componentdidmount
Regards,
Daniel