๐Ÿ“ฆ cescoferraro / rambo

๐Ÿ“„ text.tsx ยท 20 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20import * as React from 'react';
import { TextInput, View, Text } from 'react-native';

export default function MyTextInput(props) {
    const { input, meta: { error, pristine }, ...inputProps } = props;
    return (
        <View>
            <TextInput
                style={{ height: 50 }}
                {...inputProps}
                onChangeText={input.onChange}
                onBlur={input.onBlur}
                onFocus={input.onFocus}
                value={input.value}
            />
            {!pristine ? <Text>{error}</Text> : null}
        </View>
    );
}