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

207
Views
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 answers
Answer question

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 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!