Q:

I want to set selected value of flat list view into the input field in react native

When a user selects an item from flat list, I want that selected item set to the input field.
I am using a flat List view for display records data in Flat list coming from the database
Please anyone help me,to what i can do,tell me i am doing wrong
searchText(e) {
    this.setState({ searchCustomer: text, display_List: 'flex' })
    let text = e.toLowerCase()
    let trucks = C_name
}
renderRow = (item) => {
    return (
        <TouchableOpacity>
            <ListItem
                hideChevron={true}
                // item={item}
                title={`${item} `}
                onPressItem={this.onPressAction(item)}
            />
        </TouchableOpacity>
    );
}
onPressAction = (rowItem) => {
    console.log('ListItem was selected');
    // console.log(`User${rowItem}`);
    console.log(`User${rowItem.value}`);
    this.setState({
        selectedItem: rowItem.value
    });
    //  console.log(`User${this.state.selectedItem}`);
}
render() {
    return (        
                <FormLabel>Search Customer</FormLabel>
                <FormInput
                    inputStyle={styles.SearchCustomer}
                    placeholder="Search Customer"
                    value={this.state.selectedItem}
                    onChangeText={(text) => this.searchText(text)} />
                <List
                    containerStyle={{
                        display: this.state.display_List,
                        borderTopWidth: 0, borderBottomWidth: 0,
                    }}>
                    <FlatList
                        ItemSeparatorComponent={this.renderSeparator}
                        data={C_name}
                        rightIcon='hideChevron'
                        extraData={this.state}
                        keyExtractor={(item) => item}
                        renderItem={({ item }) => (                               
                            this.renderRow(item)
                        )} />
                </List>

        );
    }

}

A:

 renderRow = (item) => {
    return (
        <TouchableOpacity>
            <ListItem
                hideChevron={true}
                id={item.CCODE}
                onPress={() => this.onPressAction(item.CNAME)}
                title={`${item.CNAME} `}
            />
        </TouchableOpacity>
    );
};

onPressAction = (name) => {
    this.setState( {
        searchCustomer:name,display_List: 'none'
    }); 
};

render() {
    return (
        <ScrollView>
            <View style={styles.container}>
               <FormLabel>Search Customer</FormLabel>
                <FormInput
                    inputStyle={styles.SearchCustomer} 
                    placeholder="Search Customer"
                    onChangeText={(text) => {this.searchText(text)}}
                    value={this.state.searchCustomer}
                  />

                <List
                    containerStyle={{
                        display: this.state.display_List,
                        borderTopWidth: 0, borderBottomWidth: 0,
                    }}>
                    <FlatList
                        ItemSeparatorComponent={this.renderSeparator}
                        data={C_name}
                        rightIcon='hideChevron'
                        extraData={this.state}
                        keyExtractor={(item) => item.CCODE}
                        renderItem={({ item }) => (
                            this.renderRow(item)
                        )} />
                </List>
            </View>
            </ScrollView>

I am doing like that and it works fine

