leozdgao / react-async-script-loader

A decorator for script lazy loading on react component
MIT License
258 stars 55 forks source link

Is it possible to load the script on window or dom load? #13

Open shri3k opened 7 years ago

shri3k commented 7 years ago

Hi, this is more of a question than an issue but I was wondering if it was possible to load the script after the window has loaded or DOM has loaded on the page.

I technically can put an event handler (like DOM, window loaded etc) in componentDidMount on my component but this kinda becomes an issue when we're using stateless components. It'd be nice if react-async-script-loader actually supported this natively. Any thoughts?