I have a gallery page in my blog directory, hosted by Plesk. Built fromvite + reactboilerplate, it’s a very simple SPA.WhyBefore this, my gallery page works like this:It’s a SPA, so runtime files need to load and initiate first. When page document was downloaded and parsed, the browser started loadingfiles and after our needed JavaScript files were downloaded and executed.I have the data fetching logic like this:index.jsx123456789101112131415const[list, setList] =useState([]);const[loaded, setLoaded] =useState(false);constgetData=async() => {constresponse =await(awaitfetch("https://api.ly
...
继续阅读
(199)