Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

183
Views
How to bind value coming from api react native Picker

How to bind the value coming from API. I am getting value maharastra from api in react native picker. i.e. state_name: maharashtra, This code is for Add form and Update form

  getState(id) {
    this.setState({ inputCountry: id })
    getState(id)
      .then((responseJson) => {
        this.setState({ stateData: responseJson })
      })
      .catch((error) => {
        setLoaderVisible(false);
      });
  }

renderStateList() {
    return this.state.stateData.map((stateData) => {
      return <Picker.Item label={stateData.state} 
      value={stateData.state} />
    })
  }

<View style={styles.formRow}>
            <View style={{ flexDirection: 'row' }}>
              <Text style={styles.formText}>{__('Current State')}</Text>
              <Text style={{ fontSize: 15, color: 'red' }}>{__('*')}</Text>
            </View>
            <View style={{ borderBottomWidth: 1.5, borderBottomColor: '#92a1c0' }}>
              <Picker
                selectedValue={this.state.inputState}
                value={this.state.inputState}               //here i need value maharastra
                onValueChange={(itemValue, itemIndex) =>
                  this.getCity(itemValue)
                }>
                {this.renderStateList()}
              </Picker>
            </View>
          </View>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!