Как повесить событие на TextInput когда 2раза нажму на него что то произошло и первый раз когда нажму фокус должен быть. Внутри текст вводить ненадо

import React, {useEffect, useState} from 'react';
import {StyleSheet, Text, View} from 'react-native';
import { TextInput } from 'react-native-element-textinput';
import DoubleClick from "react-native-double-tap";

const TextInputComponent = () => {
    const [origin, setOrigin] = useState('');
    const [dastination, setDastination] = useState('');
useEffect(()=>{

}, [origin, dastination])
    return (
        <View style={styles.container}>
<DoubleClick
                    // singleTap={() => {
                    //     alert("one click")
                    // }}
                    doubleTap={() => {
                       alert('two click')
                    }}
                    delay={500}
                >
                   <TextInput
                value={origin}
                style={styles.input}
                inputStyle={styles.inputStyle}
                labelStyle={styles.labelStyle}
                placeholderStyle={styles.placeholderStyle}
                textErrorStyle={styles.textErrorStyle}
                //label="From"
                //placeholder="From"
                placeholderTextColor="gray"
                focusColor="blue"
               editable={false}
                autoFocus={true}
                // onBlur={()=>Keyboard.dismiss()}
                onChangeText={text => {
                    setOrigin(text)
                }}

                >
              
            </TextInput>
                </DoubleClick>
            



            <TextInput
                value={dastination}
                style={styles.input2}
                inputStyle={styles.inputStyle}
                labelStyle={styles.labelStyle}
                placeholderStyle={styles.placeholderStyle}
                textErrorStyle={styles.textErrorStyle}
                label="Wheretogo"
                placeholder="Where to go?"
                placeholderTextColor="gray"
                focusColor="blue"
                onChangeText={text => {
                    setDastination(text);
                }}
            />
        </View>

//DoubleClick здесь не  требуется потому что у него есть delay={200} а  мне надо чтобы любое время когда нажму на TextInput работал. 
    );
};

export default TextInputComponent;

const styles = StyleSheet.create({
    container: {
        padding: 16,
    },
    input: {
        height: 55,
        paddingHorizontal: 12,
        borderRadius: 8,
        borderWidth: 3,

    },
    input2:{
        marginTop: 50,
        height: 55,
        paddingHorizontal: 12,
        borderRadius: 8,
        borderWidth: 3,
    },
    inputStyle: { fontSize: 16 },
    labelStyle: {
        fontSize: 14,
        position: 'absolute',
        top: -10,
        backgroundColor: 'white',
        paddingHorizontal: 4,
        marginLeft: -4,
    },
    placeholderStyle: { fontSize: 16 },
    textErrorStyle: { fontSize: 16 },
});

Ответы (0 шт):