Skip to content
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

How could I add typescript support ? #89

Open
johannbuscail opened this issue Nov 21, 2020 · 5 comments
Open

How could I add typescript support ? #89

johannbuscail opened this issue Nov 21, 2020 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@johannbuscail
Copy link

I would like to add typescript support but I don't really understand how crnwa works.
Could you explain to me in details what happens when I run npx crnwa myapp ?

@orYoffe
Copy link
Owner

orYoffe commented Nov 21, 2020

I would love to add support myself, just not sure how people use react native web with typescript support

@orYoffe orYoffe added the help wanted Extra attention is needed label Nov 22, 2020
@johannbuscail
Copy link
Author

Please check out Ben Awad's tutorial

@orYoffe
Copy link
Owner

orYoffe commented Nov 28, 2020

@johannb75 thanks for the resource.

I'm doing a bit of digging to figure out the current convention as the video tutorial a bit outdated and @types/react-native doesn't exactly fit the same types as RNW

for some reference of what I'm looking at:
necolas/react-native-web#1684
necolas/react-native-web#832

If you are trying to set up a project today there's a nice template I read good opinions on:
https://github.com/ethanneff/react-native-web-typescript

@johannbuscail
Copy link
Author

johannbuscail commented Dec 8, 2020

Have you found a way to implement it ? I can help you if you want

@orYoffe
Copy link
Owner

orYoffe commented Dec 8, 2020

I'm sorry to say i didn't. There isn't proper type support for RNW (react native web) ATM from what I understand.

The solution of Ben Awad uses an old RNW version and separated versions as a result. At that time RNW didn't support hooks so you had to do that.

Any other ideas?
Would love a start example if you have a solution.. like a code example or even a PR or a react native template that we could use instead of the current template that we use in 'cli.js' file of this repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants