Switch branches/tags
Nothing to show
Clone or download
Latest commit 2884754 Jan 3, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
android commit generated android, ios files Aug 2, 2017
ios commit generated android, ios files Aug 2, 2017
src HMR Jan 3, 2018
.gitignore commit generated android, ios files Aug 2, 2017
.npmignore support not ts Aug 2, 2017
README.md fix typo Jan 3, 2018
index.android.js support not ts Aug 2, 2017
index.electron.js support electron Aug 2, 2017
index.html support not ts Aug 2, 2017
index.ios.js support not ts Aug 2, 2017
package.json HMR Jan 3, 2018
tsconfig.json support not ts Aug 2, 2017
webpack.config.ts HMR Jan 3, 2018
yarn.lock HMR Jan 3, 2018

README.md

RXPHelloWorld

This app works on React Native (iOS, Android) and web. Most of the app's code is contained in App.tsx.

The commands in the instructions below assume you are in the root of this repo.

Initial Setup

  • Run npm install. This fetches the dependencies.

Building for Web

  • Run npm run web-watch. This compiles the TypeScript code and recompiles it whenever any files are changed.
  • Open index.html in your browser to view the result.

Building for React Native

  • Run npm run rn-watch. This compiles the TypeScript code and recompiles it whenever any files are changed.
  • In another command prompt run npm start. This starts the React Native Packager.
  • Use Xcode or Android Studio to build and deploy the native app code just like you would with any other React Native project.

Changelog

based on code generated from react-xp-app

  • Support .js, .jsx modules via babel-preset-react-app.
// ./JsComponent.js

import React from 'react'
import * as RX from 'reactxp'

const JsComp = ({children, ...props}) => <RX.Text {...props}>{children + '!!!'}</RX.Text>

export default JsComp

// ./TypedComponent.tsx

import RX = require('reactxp');
import JsC = require('./JsComponent');
const JsComponent = JsC.default as any

export = () => <RX.View><JsComponent>Foo</JsComponent></RX.View>
  • Support Electron
# generate the js bundle
yarn web-watch

# on other terminal
yarn electron 
  • Support HMR
# local server hosting
yarn web