简体   繁体   中英

Are async and defer attributes in script tag in HTML irrelevant for SPA apps?

a question about the async and defer attribute in the script tag, I understand that we can use them to prevent the browser from being blocked for these scripts to download and render the page without waiting.

But I wonder if any SPA React app since the HTML is empty to begin with and it is React that builds out the DOM from the bundled script, does that mean these async and defer are irrelevant for these SPA apps?

If you are using external CDN libraries and you are more concerned about the performance then using async and defer attributes will definitely make sense.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM