Detecting when the component tree is fully built

I’m using an external Javascript component that sets its own size based on its contents and the space it’s in.

When I attach it in the usual manner (via an AbstractJavaScriptComponent), the offsetWidth of the entire tree is zero, since it hasn’t yet been attached to the rest of the DOM.

Is there a way to detect at what point it’s been attached or fully built, so that I can send a message to that component to resize itself?