Le Moi
Le Moi

Reputation: 1025

Prevent TS errors when importing untyped JS

I am getting the following Typescript error in a React application when attempting to import untyped JS functions:

Variable 'initialiseConfig' implicitly has type 'any' in some locations where its type cannot be determined.  TS7034

Is there a way to prevent TS getting upset about certain imported, untyped JS?

Upvotes: 0

Views: 422

Answers (1)

Mário Garcia
Mário Garcia

Reputation: 575

You can use the require statement instead of import ... from when importing libraries that doesn't have type declaration.

Upvotes: 0

Related Questions