create-react-native-web-app icon indicating copy to clipboard operation
create-react-native-web-app copied to clipboard

How could I add typescript support ?

Open johannbuscail opened this issue 5 years ago • 5 comments

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 ?

johannbuscail avatar Nov 21 '20 11:11 johannbuscail

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

orYoffe avatar Nov 21 '20 17:11 orYoffe

Please check out Ben Awad's tutorial

johannbuscail avatar Nov 28 '20 17:11 johannbuscail

@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: https://github.com/necolas/react-native-web/issues/1684 https://github.com/necolas/react-native-web/issues/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

orYoffe avatar Nov 28 '20 20:11 orYoffe

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

johannbuscail avatar Dec 08 '20 20:12 johannbuscail

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

orYoffe avatar Dec 08 '20 20:12 orYoffe