Comments (8)
I found two issues, and fixing these made the app load in iOS Simulator. Let me know if this also works for you, so that I can close this issue.
- Missing
packagerOpts
inapp.json
, i.e.
"packagerOpts": {
"sourceExts": [
"ts",
"tsx"
],
"transformer": "node_modules/react-native-typescript-transformer/index.js"
}
- You have to use Expo's version of React Native, so change the
react-native
dependency inpackage.json
to
"react-native": "https://github.com/expo/react-native/archive/sdk-22.0.1.tar.gz"
from expo-and-typescript.
I think I've seen a similar error because I forgot that the main component should use export default class
on the main component - the rest of them use export default
. I might be possible to avoid having to use default
by writing App.js
a bit differently, but I haven't investigated that.
Regarding the warnings, it would certainly be a big help, if you uploaded a the project to GitHub. I haven't seen these before, and my guess is that it's a simple syntax typo in app.json
.
from expo-and-typescript.
First of all, Merry Christmas! :)
Secondly, here's the branch https://github.com/Rolandisimo/habits/tree/migrate-to-ts
Please check it out, whenever you have time
from expo-and-typescript.
Great! It works perfectly now. Really appreciate the help. :)
Could you please clarify why the expos version of react native is required?
Cheers!
from expo-and-typescript.
I've used this repo as a template and having the exact same problem but don't have missing packagerOpts
or wrong react-native
dependency.
I am using Expo SDK v25.0.0 though. Is there anything obvious I can try to check? Do I have to somehow manually run TS compiler (thought that's what the transformer does).
How are you guys running the app? I am using exp start
.
from expo-and-typescript.
@Elijen: No, you don't have to manually run the TypeScript compiler. I am running the app using the Expo XDE because I find that the easiest way to launch the iOS Simulator, and I haven't tried this app using the command line.
I do however get a long list of these errors if I run yarn upgrade
, so if you're install the packages with npm, that might not work, because you're getting newer versions of the dependencies' dependencies.
node_modules/@types/react-navigation/node_modules/@types/react/index.d.ts(3756,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'DetailedHTMLProps<AnchorHTMLAttributes, HTMLAnchorElement>', but here has type 'DetailedHTMLProps<AnchorHTMLAttributes, HTMLAnchorElement>'.
I'll try to upgrade the app to the newest versions of the packages, including Expo 25. At the bottom of this blog post there is a detailed description of how to upgrade: https://blog.expo.io/expo-sdk-v25-0-0-is-now-available-714d10a8c3f7.
from expo-and-typescript.
@janaagaard75 Thanks, I've made it work after a long time of debugging. One of the problems was wrong app.json
(not sure why exp didn't throw a warning that some options are unrecognized).
Expo 25 seems to work fine. Here's the repo: https://github.com/Elijen/react-native-web-stack
from expo-and-typescript.
Great. I just updated this project to Expo 25, so that hopefully others won't run into the same issue as you.
from expo-and-typescript.
Related Issues (16)
- App is not running. HOT 3
- Logo proposal HOT 3
- expo.d.ts status HOT 3
- Typescript module alias config ? HOT 23
- new feature: testing, jest & snapshot HOT 4
- tsconfig.json doesn't appear to have any affect. HOT 2
- error TS2339: Property 'create' does not exist on type 'typeof Sound'. HOT 3
- check-types: should I pass a watch flag? HOT 2
- No errors being displayed in VS Code HOT 2
- TSLint Airbnb HOT 3
- How can I use javascript with hybrid environment? HOT 3
- Issue loading the project for first time. HOT 3
- web version wont start HOT 4
- merge with @types/expo HOT 11
- clarify hot reloading HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from expo-and-typescript.