BenJeau / react-native-draw

SVG based data-driven React Native drawing component 🎨
https://www.npmjs.com/package/@benjeau/react-native-draw
MIT License
131 stars 41 forks source link

VSCode is unable to find types #62

Closed Gamez0 closed 2 years ago

Gamez0 commented 2 years ago

On what kind of device are you using this library?

Environment

- OS:Window 10
- react-native: 0.68.2
- @benjeau/react-native-draw: 0.8.1
- react: 17.0.2
- @types/react-native: 0.67.3
- typescript: 4.4.4
- @babel/core: 7.12.9

Current Behavior

image

Expected Behavior

should be able to find a declaration file for module.

Steps To Reproduce

import CanvasRef in Typescript React Native Project with environment given above.

Anything else?

Seems Typescript can't find declaration file in the module. Is't this project meant to be used in typescripts based projects? (I've solved my issue by declaring the interfaces that I need. But definitely there's a better way to solve it)

BenJeau commented 2 years ago

That is weird, since the code is written in typescript and the types can be found within the node_modules folder

Screen Shot 2022-05-18 at 2 30 43 PM

I seem to have found a way to make it work - let me publish a new version with the fix

BenJeau commented 2 years ago

Now this should properly work on version 0.8.3 of @benjeau/react-native-draw and 0.2.2 of @benjeau/react-native-draw-extras 🚀

Screen Shot 2022-05-18 at 3 11 53 PM

Feel free to re-open this issue if this is not fixed for you

Gamez0 commented 2 years ago

Hi thanks for the new version! It fixed my problem #

I seem to have found a way to make it work - let me publish a new version with the fix

I was wandering if you could share what the problem was and how did you fixed it Thanks in advance

BenJeau commented 2 years ago

You can see the changes here https://github.com/BenJeau/react-native-draw/commit/719f45e998f48a0753e9c596fa10952b48cce635, basically the package.json was not pointing to the right location for the types