Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

199
Vistas
React Native da un error de excepción de componente al intentar usar el componente de gráfico Victory

Entonces, estoy tratando de usar la biblioteca Victory para reaccionar de forma nativa a fin de dibujar un gráfico de líneas para mi aplicación de presupuesto. Aquí está el código que tengo en mi componente Graph

 import React from 'react'; import { View, StyleSheet } from 'react-native'; import { VictoryLine } from 'victory'; export default function Graph() { return ( <View> <VictoryLine /> </View> ) }

Aquí está el código de dónde se está importando el componente

 import React from 'react' import { View, Text, StyleSheet, TextInput } from 'react-native' import Graph from './Line' export default function MonthSummary() { return ( <View style={styles.container}> <Text style={styles.title}>My Summary</Text> <Text style={styles.subtitle}>£1,325</Text> <Graph /> </View> ) } const styles = StyleSheet.create({ container: { backgroundColor: 'white', width: 350, height: 200, padding: 20, shadowColor: "#000", shadowOffset: { width: 0, height: 2, }, shadowOpacity: 0.25, shadowRadius: 3.84, elevation: 5, }, title: { textTransform: 'uppercase', fontSize: 14, fontWeight: '600', color: '#333333', }, subtitle: { color: '#333333', fontSize: 30, marginTop: 5, } });

Pero cuando ejecuto mi aplicación, aparece un error de excepción de componente. Captura de pantalla aquí . ¡Si alguien pudiera ayudar, sería increíble, ya que he estado luchando con eso durante horas!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Parece que está utilizando la biblioteca web en lugar de la nativa de reacción. Siga esto para configurarlo y cambiar su componente gráfico para que se vea así

 import React from 'react'; import { View, StyleSheet } from 'react-native'; import { VictoryLine } from 'victory-native'; export default function Graph() { return ( <View> <VictoryLine /> </View> ) }
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda