React Native - Get current value of picker item

React Native - Get current value of picker item

<strong>I have this problem:</strong>

I have this problem:

I use this library: https://www.npmjs.com/package/react-native-sqlite-storage

How to display tool_count for current tool_name with Picker?

For example tool_name = 'qwerty' and tool_count for this tool_name = 12.

This is my code:

export default class createToolWorker extends React.Component {

constructor(props) {

super(props);

this.state = {
    isLoading: true,
    tool_name: '',
    tool_nameError: null,
    tool_count: '',
    tool_countError: null,
}

this.getAllTools();

}

getAllTools = () => { db.transaction((tx) => { tx.executeSql('SELECT * FROM table_tools', [], (tx, results) => { let rows = results.rows.raw(); this.setState({ data: rows, isLoading: false }); this.arrayholder = rows; }) }); }

render() {

if (this.state.isLoading) {
    return (
        &lt;View style={{ flex: 1, paddingTop: 20 }}&gt;
            &lt;ActivityIndicator /&gt;
        &lt;/View&gt;
    );
}

return (

    &lt;Container&gt;
        &lt;Content style={responsive.workerForm}&gt;
            &lt;View style={responsive.workerFormBox}&gt;
                &lt;Form&gt;
                &lt;View style={{ marginTop: 15 }}&gt;
                        &lt;View style={responsive.workerFormBoxView}&gt;
                            &lt;View&gt;
                                &lt;Label style={custom.workerFormBoxLabel}&gt;Име на инструмент:&lt;/Label&gt;
                            &lt;/View&gt;
                            &lt;View&gt;
                                &lt;Picker
                                    selectedValue={this.state.tool_name}

                                    onValueChange={(itemValue, itemIndex) =&gt; this.setState({ tool_name: itemValue })} &gt;

                                    {this.state.data.map((item, key) =&gt; (
                                        &lt;Picker.Item label={item.tool_name} value={item.tool_name} key={key} /&gt;)
                                    )}

                                &lt;/Picker&gt;
                                &lt;Text style={{ color: '#FF0000', position: 'absolute', right: 0, top: 35 }}&gt;{tool_nameError ? tool_nameError : null} &lt;/Text&gt;
                            &lt;/View&gt;
                        &lt;/View&gt;
                    &lt;/View&gt;

                &lt;/Form&gt;
            &lt;/View&gt;
        &lt;/Content&gt;
    &lt;/Container&gt;

);

}


I will be very thankful if you help me :)

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

How to Build React Native Wrappers for Native SDKs

React native is an open-source framework for cross-platform mobile development that lets us build mobile apps using Javascript. It works by providing a bridge that facilitates the communication between Javascript and native modules. In this post, we discuss How to Build React Native Wrappers for Native SDKs

Getting Started with React Native in 2020: Build Your First App

Getting Started with React Native in 2020: Build Your First App. How To Code Your First Mobile App Using React Native. Learn how to build your first React Native app with important basic concepts. Learn the basics of React Native, a JavaScript Native Mobile App compiler. We look into components, events, props and passing them and more.

React Native App Development Company in New York

Hire top react native app development company in New York to build and develop custom react native mobile apps for Android & iOS with the latest features.