-
In migrating from JavaScript to TypeScript with Fancybox 5, I ran into one challenge I was not able to overcome. The docs give an example code:
This line works just fine in my JS, but as soon as I convert to TS, the I see at https://github.com/fancyapps/ui/blob/main/types/Fancybox/Fancybox.d.ts that the Incidentally, my modals worked just fine when I removed this |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi, What TS version are you using? I do not see any issues, see this demo - https://stackblitz.com/edit/typescript-5so1ox?file=index.html,index.ts,style.css |
Beta Was this translation helpful? Give feedback.
I'm sorry, but I don't know what to answer. The code is fine, everything works wonderfully as you can see in the demo (or any other demo you can find in the docs).
If you're stuck with TS4 (which is very buggy), then just throw in
@ts-ignore
and forget about it.The script can guess that you want to display an inline element because
src
starts with#
. Thesrc
value can be any selector, but, if you use anything else, the script won't be able to guess correctly and you can specify the content type directly.