79350426

Date: 2025-01-12 18:10:08
Score: 1.5
Natty:
Report link

Where is test function called, is it synchronous so the script isn't fully loaded?

Maybe using an asynchronous call can avoid the problem:

    const useScript = url => {
      const script = document.createElement('script');
    
      script.src = url;
      script.async = true;
      console.log("script");
      document.body.appendChild(script);
    };
    return (
        <div>
          <button onClick={test}>Run Test</button>
          <div id="myOutput"></div>
        </div>
    );
Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): Where is
  • Low reputation (1):
Posted by: zonbi inu