teodosii / react-notifications-component

Delightful and highly customisable React Component to notify your users
https://teodosii.github.io/react-notifications-component/
MIT License
1.27k stars 73 forks source link

Exported types have bad imports and there's no "types" record in package.json #124

Closed pbitkowski closed 2 years ago

pbitkowski commented 3 years ago

Hi,

Your package looks great, kudos for building it! I would love to use it but when I import it I get TypeScript error:

TS2307: Cannot find module 'react-notifications-component' or its corresponding type declarations.

I checked your index.d.ts and see:

import container from 'src/components/Container';
import store from 'src/store';
export { store };
export default container;

Where there's no src directory

Also in package.json there's no "types" record that would indicate where to search types.

Repro: https://codesandbox.io/s/relaxed-saha-4sxqn?file=/src/App.tsx

I could help you with exporting types if you want :)

OkancanCosar commented 2 years ago

is it about installing types? yarn add @types/react-notifications-component

teodosii commented 2 years ago

The declarations are in the build folder, but for some reason the index.d.ts had the imports referenced from src instead of . Watch out for the next release, will have this fixed.

@pbitkowski

Fixed in 3.2.0