yarn global add lix
lix download # install haxe libraries
haxe ios.hxml # build ios
haxe android.hxml # build android
cd bin
yarn # install node modules
yarn ios # run ios
yarn android # run android
In a nutshell:
- Create a new React Native project according to the official documentation
- Create a Haxe project with Coconut (coconut.react-native)
- Replace the "entry point view" with one built with Coconut
Typically, the "entry point view" is registered with
AppRegistry.registerComponent('my-app', () => Main);
Since anycoconut.react.View
is a legitimate react component, so it can be used directly for registration. You can use Haxe's@:expose
metadata to obtain the reference in JS and register there. You can also callregisterComponent
in Haxe code directly.