#Import type error due to importing from jsx file

8 messages · Page 1 of 1 (latest)

proper nexus
#

how can i stop vscode from showing this error on the image? The site works fine and the library i got is in JS.

lament flume
#

@proper nexus that's the wrong mindset

#

the main question is: "why do I get that error and how can I fix it?"

#

and the answer would be:
TS doesn't know the types of what you are trying to import, and can't type-check your code properly

#

one solution would be to write the type definition for that JS library

#

another solution would be to silence the error by using // @ts-ignore

#

but I don't recommend it, since TS won't know any types for that part of the code, will consider everything as being of type any, and won't do any type-checking

#

and what would be the point of using TypeScript if you are not doing any type-checking? think