integrating typescript into my project breaks import statements #5002
Unanswered
aguetkriegerisch
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
first of all, in order to use the new documentation examples with typescript, it forces me to use the tsconfig.json file


which also forces me to delete the jsconfig.json file
my project uses react router dom to handle views, and when implementing react-select typescript, imports stop working, for example


Considering that I don't know typescript, and having read a lot of documentation about the use of paths and baseUrl in the tsconfig.json file, I tried several configurations but none of them worked for me, and it seems very complicated to be able to integrate react-select, but I am very interested in using it for the potential it has in my project.
My question is if there is an easier way to integrate typescript with jsx while resolving conflicts when importing project components.
The solution that seemed the most logical to me was to change compileroptions.jsx from 'react-jsx' to 'preserve', as I read from here:
https://blog.mgechev.com/2015/07/05/using-jsx-react-with-typescript/
here:
https://www.typescriptlang.org/docs/handbook/jsx.html
and here
https://www.typescriptlang.org/tsconfig#jsx
Beta Was this translation helpful? Give feedback.
All reactions