zaku-react-native
v0.1.44
Published
Readme
Zaku React Native
Requirements
- Node v8.4.0
- Yarn
- React Native
Installation
$ yarn add zaku-react-native
Usage
import { Component } from "react";
import { View } from "react-native";
import { ZakuTextInput } from "zaku-react-native";
class App extends Component {
const fields = {
type: 'number',
label: 'What is you favorite number?',
required: false,
default: '0',
placeholder: 'number',
minLength: '0',
maxLength: '5',
key: 'keysurveynumber'
};
const style = {
label : { color: 'red' },
element : { border: '1px' },
};
onChange = (value) => {
console.log(value);
}
render() {
return (
<View>
<ZakuTextInput fields={fields} style={style} onChange={onChange}/>
</View>
)
}
}Components
ZakuTextInput
This is just React Native's TextInput component being wrapped to handle the CMS template fields
Props
| Prop | Description | Required | | ---- | ---- | ----- | | style | The React Native Stylesheet object | Yes | | fields | CMS template object | Yes | | onChangeText | onChangeText function of TextInput | Yes |
ZakuPicker
This is just React Native's Picker component being wrapped to handle the CMS Select Template
Props
| Prop | Description | Required | | ---- | ---- | ----- | | style | The React Native Stylesheet object | Yes | | fields | CMS template object | Yes | | onValueChange | onValueChange function of Picker | Yes | | mode | Picker mode | Yes |
Development
- Clone this repository
- Create a separate branch
- Push your changes to that branch
- In your local react-native app, execute
$ yarn add <repo-url>#<commit> - Run your react-native app
