banthagroup / fslightbox-react

Basic version of Fullscreen Lightbox for React.js. Website: https://fslightbox.com/react
MIT License
169 stars 23 forks source link

Could not find a declaration file for module 'fslightbox-react' #239

Open yamilelias opened 10 months ago

yamilelias commented 10 months ago

The package is missing a Typescript module declaration.

error TS7016: Could not find a declaration file for module 'fslightbox-react'. '/Users/yamilelias/Development/platsage/node_modules/fslightbox-react/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/fslightbox-react` if it exists or add a new declaration (.d.ts) file containing `declare module 'fslightbox-react';`

11 import FsLightbox from 'fslightbox-react'

It is something easy to solve but it is missing in the documentation and the README file of the project.

PeterTucker commented 6 months ago

Create a file named fslightbox-react.d.ts in your project's src or typings directory (or any directory included in your TypeScript configuration) and add the following line to the file:

declare module 'fslightbox-react';