Guest User

Untitled

a guest
May 24th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. const renderField = ({ label, keyboardType, name, meta: { touched, error }, input: { onChange, ...restInput } }) => {
  2. this.state = {
  3. value: ''
  4. }
  5. return (
  6. <View style={{ flexDirection: 'column', height: 70, alignItems: 'flex-start' }}>
  7. <View style={{ flexDirection: 'row', alignItems: 'center', borderColor: 'black', borderBottomWidth: 1, }}>
  8. <TextInput style={{ height: 37, width: 295, paddingLeft: 10, fontSize: 20, height: 350, justifyContent: "flex-start" }}
  9. keyboardType={keyboardType} value={this.state.value} onChangeText={(value) => this.setState({ value })} {...restInput}
  10. placeholder={label} numberOfLines={10} multiline={true} maxLength={100}
  11. >
  12. </TextInput>
  13. </View>
  14. <Text>
  15. Characters Left: {this.state.value.length}/100
  16. </Text>
  17. {touched && ((error && <Text style={{ color: 'red', }}>{error}</Text>))}
  18. </View>);
  19. };
Add Comment
Please, Sign In to add comment