teambit / envs

Component development environments for the Bit community
https://bit.dev/bit/envs
Other
63 stars 9 forks source link

React native typescript compiler - Cannot find namespace 'JSX' #163

Open olgaababic opened 3 years ago

olgaababic commented 3 years ago

I am facing error when trying to build my component with new react-native-typescript compiler. I get a lot of errors.

Steps to Reproduce

My bit.json (compiler part) looks like this:

 "bit.envs/compilers/react-native-typescript@0.0.3": {
        "dependencies": {
          "@types/react": "^16.9.23",
          "@types/react-native": "^0.61.17"
        },
        "rawConfig": {
          "compilerPath": "typescript/bin/tsc",
          "compilerArguments": ["--declaration"],
          "compiledFileTypes": [".ts", ".tsx"],
          "configFileName": "tsconfig.json",
          "tsconfig": {
            "compilerOptions": {
              "outDir": "dist",
              "allowJs": true,
              "target": "es5",
              "module": "commonjs",
              "strict": false,
              "declaration": true,
              "esModuleInterop": true,
              "forceConsistentCasingInFileNames": true,
              "jsx": "react",
              "typeRoots": [
                "./node_modules/@types"
              ]
            },
            "exclude": ["./node_modules/**/*"]
          },
          "development": true,
          "copyPolicy": {
            "ignorePatterns": ["package.json", "package-lock.json", "tsconfig.json"],
            "disable": false
          }
        }
      }

Expected Behavior

Maybe I am using this configuration wrong.

Specifications