react-treebeard icon indicating copy to clipboard operation
react-treebeard copied to clipboard

TypeScript fails to recognize babel-ized module or import cleartext

Open mcd-php opened this issue 7 years ago • 2 comments

I code for react-native in TypeScript.

Then I import form this module, TypeScript refuses to believe that modules do implement React component interface, because they are mangled by Babel in /lib

Then I write my own src/treebeard/orig/index.ts and import Treebeard from '../../../node_modules/react-treebeard/src/components/treebeard', the compiler explodes with error TS6059: File '/my_project/__tests__/index.android.js' is not under 'rootDir' 'my_project/src'. 'rootDir' is expected to contain all source files.

Please change the module to be TS-friendly, create another npm module with imports and re-exports of cleartext JS files, or provide thorough by-step instruction with example on how to use this module with TS.

Now my project is stuck and the only way I see to unstuck is to create my own npm module with cleartext re-exports, but the true owner will be you, and by my module I will block this path. Or else I should run private npm server with my re-export module, severely complicating my processes.

mcd-php avatar Aug 07 '17 14:08 mcd-php

@mcd-php If you want, you can always post a PR with the suggested changes. 🙂

MichaelDeBoey avatar Aug 07 '17 20:08 MichaelDeBoey

Perspectives?

stasgm avatar Aug 17 '18 12:08 stasgm