Event happening after the React widget from the extension is loaded

I am loading an extension’s React widget from another class. I need an event to happen only after the widget is loaded. Inside the component I can use componentDidMount but in my class where I am extending ReactWidget I don’t know of such a feature. What’s the best way of doing this without using a timeout?

[original thread by Eiso Kant]

[Eiso Kant]

Essentially looking for a post render() event.

You can use this.toRender.push to collect callbacks which will be called after next rendering