Warning: Failed prop type: Invalid prop `data` of type `object` supplied to `LineChart`, expected an array.
See original GitHub issueFollowing 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 type
objectsupplied to
LineChart, expected an array.
Is this working as intended?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The propType of props
data
in LineChart isPropTypes.arrayOf(PropTypes.object)
.Try this
PropTypes.arrayOrObservableArrayOf(shape({})).isRequired