-2

I have a ReactJs typescript application. I am new to React development and don't know the configurations yet. I would like to include a JavaScript package. There is no @Type variant for this yet or only an old one that doesn't help me. I have read that you can write d.ts or customize the configuration to allow JavaScript. But it is nowhere explained in detail for beginners and my search results were not helpful so far. Is there a more detailed explanation/guide somewhere?

kdev
  • 11
  • 6
  • https://medium.com/@steveruiz/using-a-javascript-library-without-type-declarations-in-a-typescript-project-3643490015f3 – Robert Oct 21 '21 at 09:50
  • It's in the [official documentation](https://www.typescriptlang.org/docs/handbook/modules.html#working-with-other-javascript-libraries). – Jared Smith Oct 21 '21 at 09:51
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Oct 21 '21 at 11:44

1 Answers1

0

As written, the explanations are not sufficient. I have found my solution based on this answer: Using JS and TS in a react project

  1. create a js file which using the js component from package
  2. and then create the d.ts file works for me.
kdev
  • 11
  • 6