Importing .ts files in .tsx.
See original GitHub issueWhen import .ts
in .ts
or .tsx
in .tsx
, it doesn’t add extension. That’s great. But when I am using both extension files .ts
and .tsx
it auto completes with .ts
and etc.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Cannot import .tsx file from .ts file (and vice versa)
import WriteEditor from './write_editor.tsx';. Now my IDE tells me not to write the extensions tsx and I get an errors in src/write_editor.
Read more >How to Import another TypeScript Files ? - GeeksforGeeks
In the TypeScript file which is to be imported must include an export form and the main file where the class is imported...
Read more >An import path cannot end with a '.tsx' extension in TS
The error "An import path cannot end with a '.tsx' extension" occurs when we include the extension when importing TypeScript files in a...
Read more >Documentation - Module Resolution - TypeScript
A relative import is resolved relative to the importing file and cannot resolve to an ambient module declaration. You should use relative imports...
Read more >TypeScript - webpack
tsx files through the ts-loader , and output a bundle.js file in our current directory. Now lets change the import of lodash in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@galman33 is actually right, @MartynasZilinskas meant the exact situation that @galman33 explained. And the both extensions should be stripped, because they produce same output (
.js
file), only the processing is different according to extension, i.e. you can use JSX syntax in.tsx
file.So, conclusion is that we still need the functionality to strip both extensions.
why can’t resloved ? have same name files use setting to Path Intellisense which looks like:
this have other problems ?
it finds two files with the same name use default first . [‘jsx’,‘js’] , index.js & index.jsx use index.jsx [‘js’,‘jsx’] , index.js & index.jsx use index.js
how about this