Open danBamikiya opened 3 years ago
Hi, I'm using typescript with react-chat-engine so typescript requires me to have a type declaration module. Could you include that or tell me how to create one. Typescript version: 4.2.3
![]()
I think they haven't added a type definition for the library yet.
We can work on this in the future but we're currently not focusing on TS support. Normal JS/React will support it.
For those how are having issues with running the library with TS, you can create a react-chat-engine.d.ts
file and then inside this file add the following line code declare module "react-chat-engine";
If you create your project using create-react-app
TS is not going to complain about it, if not, in your tsconfig.json inside include
array, add as a string the name of your newd.ts
file. As @alamorre said, it is going to be supported in the future. Then, you are going to have your library with no error type. The solution we have so far for react TS. :)
Hey so I'm happy to work on this now! Any of you know where I should start? Can I make some top level declaration in the src/
folder to make it TS compatible?
Are there any docs/resources I should check out to make the project TS compatible?
Well usually you'll want users to install types for your package seperately as npm i -D @types/react-chat-engine
because it isn't written in typescript. To type your project that way visit Definitely Typed where most packages not created with typescript publish the types definition for their packages to.
Creating a react-chat-engine.d.ts
means just declaring types for what you're exporting from your package. View react type definitions files as an example of how your react-chat-engine.d.ts
file should be. ✌️
Thank you very much!
I'll give this a try, but I'll also put a bounty on this task for 50 USDC !!
If somebody can mod the Package to make this typescript supported by default, they can comment their USDC address on the PR and I'll wire it once approved.
If not I'll get to it in the next few weeks.
😄 I would have sent a PR but I'm currently on a road trip (without my laptop) and would be back home an Friday night. But I'll see what I can accomplish with GitHub Mobile.
Haha no rush! If you do it this weekend I'll get ya USDC right after - thanks a bunch this will be fun!
hey, were there any updates for this? the props are giving an error for me in TS: "Property 'height' does not exist on type 'IntrinsicAttributes'."
Still no support for ts?
Damn, still no typescript support
Hi, I'm using typescript with react-chat-engine so typescript requires me to have a type declaration module. Could you include that or tell me how to create one. Typescript version: 4.2.3
![image](https://user-images.githubusercontent.com/58262528/111079646-1a6de700-84fb-11eb-86bb-c890c7bfe12e.png)