Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

262
Visualizações
React Native TextInput onChangeText activado Modal onRequestClose

Creé un Modal con TextInput para crear un "Festival" en mi base de datos. Para crear, abro un Modal haciendo clic en "crear". Se abre Modal, TextInput funciona bien.

Pero, ¿por qué esta función TextInput onChangeText activa mi función Modal onRequestClose?

 import React, { Component } from 'react'; import { Alert, Button, Modal, Text, TextInput, StyleSheet, View } from 'react-native'; export default class EventCreate extends Component { state = { eventName: null, eventAdress: null, eventDate: null, eventPasskey: null } render() { const { onSave, toggleModal } = this.props; const { eventName, eventAdress, eventDate, eventPasskey } = this.state; return ( <Modal visible={this.props.visible} onRequestClose={console.log('wtf')} animationType={'slide'}> <View style={styles.container} > <Text>Bezeichnung</Text> <TextInput style={styles.input} onChangeText={text => this.setState({ eventName: text })} placeholder="Bezeichnung" /> <Button onPress={() => { Alert.alert( "Event speichern?", "Moechtest Du das Event" + " " + eventName + " " + "wirklich speichern?", [ { text: "Abbruch", onPress: () => console.log("Eingabe vom Benutzer abgebrochen"), style: "cancel" }, { text: "Speichern", onPress: function () { onSave(eventName, eventAdress, eventDate, eventPasskey); toggleModal(); } } ] ); }} title="SAVE" /> </View> </Modal> ); } } const styles = StyleSheet.create({ container: { alignItems: 'center' }, input: { height: 40, width: 250, margin: 12, borderWidth: 1, padding: 10, }, });
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Prueba de esta manera

 onRequestClose={() => console.log('wtf')}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda