How to trigger a JavaScript function on load?

I guess you could either do the import post rendering as in this example,

Or alternatively use a client side callback. That being said, mixing jQeury and React is typically not the best idea.