ds300/react-native-typescript-transformer

Unable to import tsx file into index.js

AntonPuko opened this issue · 1 comments

Hi, sorry if I'm asking something stupid. But does this work with the latest rn?
I stuck with very basic :(

  1. I installed fresh new project with react-native init. (react-native 0.49.5)
  2. added react-native-typescript-transformer, typescript
  3. added rn-cli.config.js
  4. added tsconfig:
{
  "compilerOptions": {
   // "allowJs" true, //was trying this also
    "target": "es2015",
    "jsx": "react",
    "noEmit": true,
    "moduleResolution": "node",
  }, 
  "exclude": [
    "node_modules"
  ]
}
  1. setup project structe as:
    --src
    ----App.jsx
    --index.js
  2. in index.js I'm trying to import App as:
    import App from './src/App';

And when I'm building the app with yarn start I get the error:
Unable to resolve module ./src/App`
So, I just can't import my component jsx into root index.js file.

I can provide the repo, but I think the screen represents all the info:
111

nevermind, I'm an idiot I messed tsx with jxs :face_palm: , need to get some sleep.