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

146
Views
cerrar Modal automáticamente en React Native

Yo uso aquí un modal. En el caso de que todo esté bien y agregué los datos a la base de datos, quiero cerrar automáticamente el modal con la línea "this.props.closeModal" pero me sale el error undefined is not an object (evaluando this.props)

closeModal se llama desde el campo EmailChildConnect.js y el valor changeshowTaskVisible

¿Algunas ideas?

ConnectModal.js

 class ConnectModal extends React.Component { addAdultConnexion = async () => { if (this.state.emailAdult !== "") { //add to the firebase in the case that is good this.props.closeModal; else { Alert.alert("", "the email does not exist"); }; } else { Alert.alert("", "field is required"); } }; render() { return ( <CustomBackground> <TouchableOpacity onPress={this.props.closeModal} > <AntDesign name="close" size={WIDTH / 17.2} color={colors.black} /> </TouchableOpacity> <View> <TextInput onChangeText={(text) => this.setState({ emailAdult: text })} value={this.state.emailAdult}/> <CustomValidationButton onPress={() => this.addAdultConnexion()}> <Text>add</Text> </CustomValidationButton> </View> </CustomBackground> ); } }

EmailChildConnect.js:

 class EmailChildConnect extends React.Component { state = { showTaskVisible: false, }; toggleisModal() { this.setState({ showTaskVisible: !this.state.showTaskVisible }); } render() { const email = this.props.email; return ( <View> <Modal animationType="slide" visible={this.state.showTaskVisible} onRequestClose={() => this.toggleisModal()} > <ConnectModal email={email} closeModal={() => this.toggleisModal()} /> </Modal> <RenderListEmail onPress={() => this.toggleisModal()} children1={email.name} children2={email.childEmail} /> </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!