fancyapps / fancybox

jQuery lightbox script for displaying images, videos and more. Touch enabled, responsive and fully customizable.
http://fancyapps.com/
7.29k stars 1.79k forks source link

Using fancyapps with react / typescript #2626

Open aminmousavi5147 opened 2 years ago

aminmousavi5147 commented 2 years ago

Hello! I'm having a problem using fancyapps with react / typescript. When I try to import { Fancybox as NativeFancybox } from '@fancyapps/ui'; I'll get the following error: Could not find a declaration file for module'@fancyapps/ui`. 'd:/ionic/myproject/node_modules/@fancyapps/ui/dist/fancybox.umd.js' implicitly has an any type. Try 'npm i --save-dev @types/fancyappsui' if it exists or add a new declaration (.d.ts) file containing 'declare module "@fancyapps/ui"'; I tried to install @types/fancyappsui but I'll get the error 404 not found! Also I created a folder with the name of the module inside of the 'node_modules/@types', containing an index.d.ts file and inside of the index file I put 'declare module "@fancyapps/ui"'. After this the error went away but if I install / uninstall a new package, fancyapps_ui folder will dissapear!

machour commented 2 years ago

You may want to ask on https://github.com/fancyapps/ui instead