URL & onLoad callback. If URL is not provided, the script will not be loaded.
@group: Hooks
useScriptLoader({ url: "https://example.com/script.js", onLoad: () => console.log("Script loaded!") });
useScriptLoader({ url: "", onLoad: () => console.log("This won't be called") }); // No script will be loaded
useScriptLoader({ url: props.url, onLoad: () => console.log("Script loaded") });
// The script will be added and the previous one will be removed every time the URL changes
Dinamically add a script tag to the document body