-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInput.js
More file actions
29 lines (27 loc) · 695 Bytes
/
Input.js
File metadata and controls
29 lines (27 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import React, { Component } from 'react';
import { View, Text } from 'react-native';
import {Item, Input, Label} from 'native-base';
export default class InputField extends Component {
constructor(props) {
super(props);
this.state = {
};
}
_onChange=(values)=>{
this.props.onChange(this.props.name , values)
}
render() {
const {label ,error,...rest} = this.props
return (
<View>
<Item stackedLabel >
<Label>{label}</Label>
<Input {...rest}
onChangeText={this._onChange}
/>
</Item>
<Text style={{color:'red' , paddingVertical:5}}>{error}</Text>
</View>
);
}
}