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

85
Vistas
React integration with Rails (basic tutorial failing)

I'm trying to integrate Victory charts to my RoR application using Shakapacker and React On Rails gem.

I've got the hello world example working, but when I use the code from Victory, I get the following error:

import PropTypes from 'prop-types';
import React, { useState } from 'react';
import style from './HelloWorld.module.css';


import { VictoryBar, VictoryChart, VictoryAxis, VictoryTheme, VictoryStack } from 'victory';



const HelloWorld = (props) => {


    const v_data = [
        {quarter: 1, earnings: 13000},
        {quarter: 2, earnings: 16500},
        {quarter: 3, earnings: 14250},
        {quarter: 4, earnings: 19000}
    ];


    return (
        <><div>
                <h1>Victory Tutorial {props.data}</h1>
                <VictoryChart
                    domainPadding={10}
                    theme={VictoryTheme.material}
                >
                    <VictoryAxis
                        tickValues={["Quarter 1", "Quarter 2", "Quarter 3", "Quarter 4"]} />
                    <VictoryAxis
                        dependentAxis
                        tickFormat={(x) => (`$${x / 1000}k`)} />
                    <VictoryStack
                        colorScale={"warm"}
                    >
                        <VictoryBar
                            data={v_data}
                            x={"quarter"}
                            y={"earnings"} />
                    </VictoryStack>
                </VictoryChart>
            </div></>
    );
};

export default HelloWorld;

Error:

Uncaught Error: Objects are not valid as a React child (found: object with keys {label, value}). If you meant to render a collection of children, use an array instead.

It seems the error has to do with passing objects as a "react child"? But that's the expected syntax from the docs.

https://formidable.com/open-source/victory/docs/

What am I doing wrong? Please help. I've spent dozens of hours on this already.

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