react-gist
react-gist copied to clipboard
Avoid using document.write()
Warning in console
index.js?c760:57 [Violation] Avoid using document.write(). https://developers.google.com/web/updates/2016/08/removing-document-write
To add more on this, in Google's documentation there's a section on how to fix this issue:
If your provider gives you a snippet that includes the document.write(), it might be possible for you to add an async attribute to the script element, or for you to add the script elements with DOM API's like document.appendChild() or parentNode.insertBefore()
Here's an example of how Google Analytics does the injection of an external JS file:
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
/* internal code for analytics */
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');