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

347
Views
reaccionar error de renderizado nativo (ver la devolución de llamada del captador de configuración para el componente 'div'?

Tengo un problema con react-native. Estoy tratando de hacer ejercicio para hacer la aplicación de tareas pendientes de cómo veo las lecciones de YouTube. ¿No puedo entender dónde está mi culpa? El instructor de Youtuber codifica todos iguales, su código funciona pero mi código no funciona.

Este es el archivo app.js:

 import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; import Task from './components/Task'; export default function App() { return ( <View style={styles.container}> <View style={styles.taskWrapper}> <Text style={styles.sectionTitle}>Today Works</Text> <View style={styles.items}> <Task text={'Task1'} /> <Task text={'Task2'} /> </View> </View> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#E8EAED', }, taskWrapper: { paddingTop: 80, paddingHorizontal: 20, }, sectionTitle: { fontSize: 24, fontWeight: 'bold', }, items: { }, });

y este es el archivo /components/Task.js;

 import React from 'react'; import { View, Text, StyleSheet } from 'react-native'; import { TouchableOpacity } from 'react-native-web'; const Task = (props) => { return( <View style={styles.item}> <View style={styles.itemLeft}> <TouchableOpacity style={styles.square}></TouchableOpacity> <Text style={styles.itemText}>{props.text}</Text> </View> <View style={styles.circular}></View> </View> ) } const styles = StyleSheet.create ({ itemLeft: { }, square: { }, itemText: { }, circular: { }, }); export default Task;

Esos códigos no funcionan.

Recibí estos errores en la exposición; Puedes ver el error aquí>

¿Qué es mi culpa?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Está importando TouchableOpacity desde 'react-native-web' (tal vez debido a intellisense). El compilador luego llena eso con un <div> en lugar de un <View> . Cámbielo a solo 'react-native' .

about 4 years ago · Juan Pablo Isaza 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!