Typescript seems to be working against me here. Here's what I want to embed:
<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/BLAH?showinfo=0"
frameBorder="0"
allow="autoplay; encrypted-media"
allowFullScreen></iframe>
The problem is the allow
attribute:
TS2339: Property 'allow' does not exist on type 'DetailedHTMLProps<IframeHTMLAttributes<HTMLIFrameElement>, HTMLIFrameElement>'.
...which is true, it's not in index.d.ts. How can I forcibly add this attribute, or somehow cast iframe
to any any type, etc?
The answer is to change the attribute from allow
to data-allow
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With