script onLoad is not triggered
See original GitHub issueThe onLoad event handler isn’t triggered for a script element
<script src="https://..." async defer onLoad={() => console.log(1)} />
(I tried with onload as well)
live demo: https://jsfiddle.net/crl/uks4pc60/
react version: 16.5.2
Issue Analytics
- State:
- Created 5 years ago
- Reactions:15
- Comments:11
Top Results From Across the Web
Javascript onload not working [closed] - Stack Overflow
Javascript onload not working [closed] · 1. any error in the browser console. – Arun P Johny · 3. There is nothing wrong...
Read more >Onload not firing on Chrome for Windows | WordPress.org
I'm having a an issue, where the onload JavaScript is not firing on Chrome for Windows, while it works on Firefox and Chromium....
Read more >Resource loading: onload and onerror
script.onload. The main helper is the load event. It triggers after the script was loaded and executed. For instance: let script = document....
Read more >Window: load event - Web APIs - MDN Web Docs - Mozilla
The load event is fired when the whole page has loaded, including all dependent resources such as stylesheets, scripts, iframes, and images.
Read more >HTML onload Event Attribute - W3Schools
The onload attribute fires when an object has been loaded. onload is most often used within the <body> element to execute a script...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The same problem here. Did someone found a solution?
@BiosBoy - in my case, which could be different from ^ his and yours, it was solved by writing the script i wanted executed onLoad as a string of Javascript:
Here i was including a script in the head of the page by including this element within a
react-helmet<Helmet>tag.These did NOT work as desired, that is, only running the
onLoadcode once, after the javascript file has been loaded: