Skip to content

haxe-react/react-native

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

haxe-react-native

Quick Start

Follow the steps here to start writing an app in less than a minute!

Manual Setup

Install Haxelibs
  1. haxelib install react-next
  2. haxelib install react-native
Setup React Native

Follow the steps here

Write some Haxe

Main.hx

package;

import react.ReactComponent;
import react.ReactMacro.jsx;
import react.native.api.*;
import react.native.component.*;

class Main
{
    public static function main()
    {
        var projectName = 'AwesomeProject';
        AppRegistry.registerComponent(projectName, function() return App);
    }
}

class App extends ReactComponent
{
    override function render()
    {
        return jsx('
            <View>
                <Text>
                    Test
                </Text>
            </View>
        ');
    }
}
Build

build.hxml

-lib react-native

-cp src
-main Main
-js index.ios.js

Then the generated index.ios.js can be used in the usual react-native workflow