ds300 / react-native-typescript-transformer

Seamlessly use TypeScript with React Native
MIT License
657 stars 50 forks source link

Unable to import tsx file into index.js #33

Closed AntonPuko closed 6 years ago

AntonPuko commented 6 years ago

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"
  ]
}

5) setup project structe as: --src ----App.jsx --index.js 6) 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

AntonPuko commented 6 years ago

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