Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

184
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda