Fable: How can we build react-native apps?

Created on 4 Jul 2016  路  8Comments  路  Source: fable-compiler/Fable

Hi @alfonsogarciacaro, thanks for this awesome library. Can we build React-native application (Android & IOS) using Fable? If we can build, It would be helpful if you provide some link and basic example to get started in mobile app development in F# using Fable.

Thanks in Advance

discussion

Most helpful comment

I ran ts2fable on the Definitely Typed react-native Type Script bindings. There is a small section of code on line 3592 that caused ts2fable to fail:
// TS2FABLE ERROR
//export interface PlatformStatic
// OS: PlatformOSType,
// only documented in PlatformSpecificInformation.md
// select({PlatformOSType: any}): any
//}
Anyway. When I comment that out ts2fable happily outputs the binding. Here's the gist:
https://gist.github.com/scitesy/a7ce07cea10248f1941a8257f64f9771

All 8 comments

Hi there! I don't see any problem why it shouldn't work but I didn't have the time to test it yet. Dave Thomas has some work on building mobile apps with Fable+Fuse. If you want to give it a try with React Native and contribute with a example or a tutorial it'd be fantastic, I'll give you as much support as I can. You can also check the gitter channel for help 馃槃

@alfonsogarciacaro I coudn't find package for fable-import-react-native in libraries.io. Like fable-import-react for doing react apps. Is there any specific package for react-native?

There's none yet, if you've typescript definition files you can give it a shot with the ts2fable parser, but please note you may have to do some manual editions. Please check the docs to learn how to interact with JS from F#/Fable.

Thanks @alfonsogarciacaro

@karthickvkumar @alfonsogarciacaro

The below gist has incomplete typescript for react native...

https://gist.github.com/bparadie/93cc1078d1db8fcd3c4e

May be we can complete that and use that to generate for Fable using ts2fable

I ran ts2fable on the Definitely Typed react-native Type Script bindings. There is a small section of code on line 3592 that caused ts2fable to fail:
// TS2FABLE ERROR
//export interface PlatformStatic
// OS: PlatformOSType,
// only documented in PlatformSpecificInformation.md
// select({PlatformOSType: any}): any
//}
Anyway. When I comment that out ts2fable happily outputs the binding. Here's the gist:
https://gist.github.com/scitesy/a7ce07cea10248f1941a8257f64f9771

@forki has done a great job with React Native, please see this example for an introductory guide on how to create React Native apps with Fable. There'll be also a blog post soon on the topic so stay tuned!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rommsen picture rommsen  路  3Comments

et1975 picture et1975  路  3Comments

stkb picture stkb  路  3Comments

MangelMaxime picture MangelMaxime  路  3Comments

SirUppyPancakes picture SirUppyPancakes  路  3Comments