I’m trying to preload a JSON file from (S3 Bucket)
Inside React-Helmet and access the object of this JSON inside ReactJS, please see below code, I have over 100 JSON files/articles and these articles should be accessible from S3, Also I have to preload the JSON file so that it can be crawled by search engines.
My question is how can I access the JSON file when is loaded without firing fetch request
?, I know if I fire fetch request
or load the files from a local folder I’m able to access it, as I said before, I have a requirement where the files will grow, any help, would be appreciated it?
console.log("Accessing JSON objects ", data.object1);
return(
<>
<Helmet>
<link
rel="preload"
href="https://****.s3.me-central-1.amazonaws.com/prod/service2.json"
as="fetch"
type="application/json"
crossorigin="anonymous"
/>
</Helmet>