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

167
Views
¿Quiero establecer el estado del componente principal del componente secundario durante onChangeText en reaccionar nativo?

Aquí quiero establecer el nombre del estado del componente principal del componente secundario mientras está en CHangeText, pero me da "TypeError: setName no es una función. (En 'setName (texto)', 'setName' no está definido)" error

Aquí está mi componente principal

 const ProfileCreationScreen = () => { const [name, setName] = useState() const userSignup = async () => { try { firestore().collection('users').doc("androiduser_mobile89").set({ name: name, }); alert("Succesfully Created") } catch (error) { alert(error); } }; return ( <SafeAreaView> <Text>Create your account</Text> <Button mode="contained" onPress={() => userSignup()}> Sign Up </Button> <View style={{ display: "none" }}> <NameScreen setName={setName} /> </View> </SafeAreaView> ) }

Aquí está mi componente hijo

 export const NameScreen = ({ setName, navigation }) => { return ( <KeyboardAvoidingView enabled behavior="padding" style={styles.container}> <View> <Text style={styles.text}>Full Name</Text> <TextInput style={styles.textField} label="Enter your Full Name" underlineColor="#FF0074" outlineColor="red" value={text} onChangeText={(text) => setName(text)} /> <Button mode="contained" style={styles.btn} onPress={() => alert(text)}> Next </Button> </View> </KeyboardAvoidingView> );
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!