diff --git a/src/hooks/useScript.tsx b/src/hooks/useScript.tsx index dabcd03..6574475 100644 --- a/src/hooks/useScript.tsx +++ b/src/hooks/useScript.tsx @@ -85,12 +85,10 @@ export default function useScript({ scriptEl.src = src; Object.keys(attributes).forEach((key) => { - // @ts-ignore - if (scriptEl[key] === undefined) { + if (!(key in scriptEl)) { scriptEl.setAttribute(key, attributes[key]); } else { - // @ts-ignore - scriptEl[key] = attributes[key]; + (scriptEl as any)[key] = attributes[key]; } });