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.

DataTable Warning: Failed prop type: Invalid prop `rows[0]` of type `array` supplied to `DataTable`, expected `object`.

See original GitHub issue

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Summary

Getting this warning when using DataTable:

Warning: Failed prop type: Invalid prop rows[0] of type array supplied to DataTable, expected object.

And I’m facing a problem with refreshing the content of the data table. I have a state variable (rows) that is attached to the data table, but I’m not fetching all the records at once and I have 2 buttons: next/prev.

I can see that the data that is coming from api when calling next/prev page is different and doing this.setState{rows: data}, but the data table is not refreshed and keep showing the first page only!

Relevant information

Sandbox: https://codesandbox.io/s/codesandbox-s4osh

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
zbeedatmcommented, Aug 6, 2019

Yes, I used i.toString() there for rows with id 0. But it’s not reproducible… will try to find out what is different in my code!

0reactions
zbeedatmcommented, Jan 7, 2021

Thanks a lot for your advice. yes, that was the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed prop type: Invalid prop `style` of type `array` supplied to ...
I'm getting this Error: TypeError: undefined is not an object (evaluating 'iter[Symbol.iterator]') once i use your suggestion. – ASIF AKBER. Oct ...
Read more >
failed prop type: invalid prop `rows` of type `object` supplied to ...
Warning : Failed prop type: Invalid prop rows[0] of type array supplied to DataTable, expected object. And I'm facing a problem with refreshing...
Read more >
type check failed for prop "data". Expected Object, got Array
I'm using laravel-vue-pagination getting this error Invalid prop: type check failed for prop "data". Expected Object, got Array. code is. Copy Code
Read more >
DataColumn.DataType Property (System.Data) - Microsoft Learn
myTable = new DataTable("My Table"); // Create DataColumn objects of data types. DataColumn colString = new DataColumn("StringCol"); colString.
Read more >
Invalid prop 'value' of type 'number' supplied to 'TextInput'
Warning : Failed Prop type: Invalid prop 'value' of type 'number' supplied to 'TextInput', expected 'string'. If you will see the code of...
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