-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with react-native-typescript-transformer #194
Comments
Thanks for reporting this. Just wanted to let you know, I've read this, but don't have a solution yet, need some time to debug. |
I have reproduced this too:
|
Note to all: Although I can't get react-native-macos init MyProject
cd MyProject
# npm install --save-dev @types/react @types/react-native typescript
yarn add --dev @types/react @types/react-native typescript
touch tsconfig.json
open macos/MyProject.xcodeproj Now add the following to {
"compilerOptions": {
"target": "es2015",
"module": "es2015",
"jsx": "react-native",
"lib": ["ES5", "ScriptHost", "ES2015.Collection"], // Standard ES5 libs
"baseUrl": ".",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true
}
} Now, run the following to automatically transpile .ts(x) files to .js: node_modules/.bin/tsc --watch ... Then, with Hot module reloading even works (from the React Native menu, just select |
@shirakaba But it's pretty hacky :( Last time i used this manual approach referenced Assets were not copied. |
Description
I have an existing project with which i create an android, ios and windows-app (react-native-windows).
This project uses "react-native-typescript-transformer" to use TypeScript as language.
I've integrated react-native-macos as explained in other issues, with modifications for the rn-cli.config.js and .babelrc.
When trying to run the app, the metro builder crashed with the following error:
Somehow I believe the transformers are not compatible with the babel-plugins replacing the import of react-native.
Reproduction Steps and Sample Code
Install "react-native-typescript-transformer" according to https://github.com/ds300/react-native-typescript-transformer in a fresh react-native-macos project and import a ts file.
(you have to install react-native, too, and add the patches needed for the rn-cli.config.js and .babelrc)
Additional Information
The text was updated successfully, but these errors were encountered: