In a SPFx solution, I'm importing a JavaScript library like this:
import './javascriptfile.js';
This JS file gets executed before the DOM is ready. If we are using a SCRIPT tag, we can use defer attribute that executes JS file after completing the DOM parsing.
Is there an equivalent method in TypeScript which executes the JS file after completing the DOM parsing?