From 5c9462286a1669f9a0749c13afb6e4d967eaa76f Mon Sep 17 00:00:00 2001 From: Tiago Ruas Date: Fri, 5 Apr 2024 21:13:42 +0200 Subject: [PATCH] Avoid cache of embed script --- public/index.html | 1 - src/App.tsx | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index f5c5e5f..3529f96 100644 --- a/public/index.html +++ b/public/index.html @@ -46,6 +46,5 @@ To begin the development, run `npm start` or `yarn start`. To create a production bundle, use `npm run build` or `yarn build`. --> - diff --git a/src/App.tsx b/src/App.tsx index 4473df4..aab37d5 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -31,6 +31,12 @@ export function App(): ReactElement { updateOffset(); window.addEventListener("resize", updateOffset); + window.onload = function () { + const embedScript = document.createElement("script"); + embedScript.async = true; + embedScript.src = `https://www.instagram.com/embed.js?version=${Date.now()}`; + document.head.appendChild(embedScript); + }; return () => window.removeEventListener("resize", updateOffset); }, []);