question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning: Failed prop type: Invalid prop `data` of type `object` supplied to `LineChart`, expected an array.

See original GitHub issue

Following the example or recharts.org, I’m passing an array of objects to a LineChart component. This seems to work visually, but throws the following error in the console. Warning: Failed prop type: Invalid prop dataof typeobjectsupplied toLineChart, expected an array.

Is this working as intended?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
xile611commented, Jul 3, 2017

The propType of props data in LineChart is PropTypes.arrayOf(PropTypes.object).

1reaction
UmerMocommented, Jun 18, 2019

Try this PropTypes.arrayOrObservableArrayOf(shape({})).isRequired

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed propType: Invalid prop of type `array` expected `object ...
So this line of code is throwing something like ' Failed propType: Invalid prop of type array expected ...
Read more >
invalid prop `rows` of type `object` supplied to `forwardref ...
Warning : Failed prop type: Invalid prop data of type object supplied to LineChart , expected an array. Is this working as intended?...
Read more >
How to validate React props using PropTypes - LogRocket Blog
Learn how to validate props with React PropTypes, React's internal mechanism for adding type checking to component props.
Read more >
FormidableLabs/victory - Gitter
Warning : Failed propType: Invalid undefined domain of type object supplied to VictoryAxis , expected array . Check the render method of VictoryAnimation...
Read more >
Common Props - Victory
type : array[object]. Specify data via the data prop. By default, Victory components expect data as an array of objects with x and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found