UI Component for using react
TODO push this to NPM repository
Currently installation guide from local disk
-
Clone this project to local disk
-
Install the package from local disk, like
npm install <disk_path> --save
-
Use UIComponent as below:
var React = require('react-native'); var TSButton = require('tsuicomponent').TSButton; var { AppRegistry, StyleSheet, Text, View, } = React; var TestUI = React.createClass({ render: function() { return ( <View style={styles.container}> <TSButton>Click Me</TSButton> </View> ); } }); var styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, }, instructions: { textAlign: 'center', color: '#333333', marginBottom: 5, }, }); AppRegistry.registerComponent('TestUI', () => TestUI);
Any chagnes that apply to this project should increate the version number in package.json, it help client to update the ui component.
"version": "0.0.1",
Currently we have 2 UI components exposed in index.js, if we have new components, please add the similar statement below:
var button = require('./TSButton');
var listView = require('./TSListview');
module.exports.TSButton = button;
module.exports.TSListView = listView;
Once the component is updated, in the client project execute:
npm updte