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

200
Views
TypeError: no se pudo construir 'Texto' ReactNative

He usado la etiqueta <Text> un millón de veces y nunca recibí este error, pero de repente, puse una etiqueta <Text> dentro de una etiqueta <Modal> y el mundo arde. Realmente no hay nada remotamente complicado en el componente en el que estoy trabajando, pero CUALQUIER <Text> dentro de '' lo rompe todo. Así es como se ve mi código...

 import React, { useState, useEffect } from 'react'; import { View, Modal, Button, ScrollView, TextInput } from 'react-native' import { settings } from "../../../Styles/SettingStyles"; import { editUserSettings } from '../../../Styles/SettingStyles'; const UpdateUserButton = (props) => { const [userInfoChanges, setUserInfoChanges] = useState({}) const handleInput = (attr, input) => { const updateObject = {...userInfoChanges} updateObject[attr] = input setUserData(updateObject) } const [modalVisible, setModalVisible] = useState(false) return( <View style={editUserSettings.editModal}> <Modal animationType='slide' transparent={true} visible={modalVisible}> <ScrollView style={editUserSettings.container}> <Text style={editUserSettings.editFields}>First Name: </Text> <TextInput name='firstname' style={editUserSettings.input} onChangeText={(firstname) => { handleInput('firstname', firstname) }} /> </ScrollView> </Modal> <Button onPress={() => setModalVisible(!modalVisible)} title="Edit User Information" color="#516ca6" accessibilityLabel="Edit User Information" /> </View> ) } export default UpdateUserButton

De la forma en que se utiliza este componente, la única parte visible del mismo será

 <Button onPress={() => setModalVisible(!modalVisible)} title="Edit User Information" color="#516ca6" accessibilityLabel="Edit User Information" />

y tan pronto como presiono este botón en el navegador, la pantalla se vuelve blanca y me da un MONTÓN de errores, todos relacionados con <Text> , el primero de los cuales se ve así...

 Uncaught TypeError: Failed to construct 'Text': Please use the 'new' operator, this DOM object constructor cannot be called as a function.

Pero esto simplemente no tiene absolutamente ningún sentido para mí. ¿Alguien tiene alguna idea?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Como mencionó @windowsill en el comentario, el texto no se importa de react-native (ni de ningún otro lugar) :)

about 4 years ago · Santiago Trujillo Report
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!