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 :)

javascript jquery react-native

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How native is React Native? | React Native vs Native App Development

Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.

Hire Dedicated React Native Developer

Have you ever thought of having your own app that runs smoothly over multiple platforms? React Native is an open-source cross-platform mobile application framework which is a great option to create mobile apps for both Android and iOS. **[Hire...

React Native Mobile App Development

Skenix is providing React Native Development Services with qualified React Native App Developers. Get the best React Native App Development Services.

Build a simple React Native Pokemon app with React-Navigation

As we start learning new technologies we want to start building something or work on a simple project to get a better understanding of the technology.

Hire Dedicated React Native Developer in India | React Native Development

Hire dedicated React Native developers for your next project. As the top react native development company we offer you the best service as per your business needs.