Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Unable to render table, #125

Unanswered
DVGY asked this question in Q&A
Discussion options

I am getting an error when trying to render table.

How to handle such cases ?

Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.

data = [
{
 "id": 1,
 "user": {
 "id": 232,
 "firstName": "Rebeka",
 "lastName": "Jacobson",
 "fullName": "Rebeka Jacobson",
 "gender": "Male",
 "gsm": "(306) 104-0810",
 "createdAt": "2023-05-25T20:43:44.627Z",
 "isActive": true,
 "avatar": [
 {
 "name": "d20e7f66-7fc0-4e41-ba9e-621f94c45ec0",
 "percent": 100,
 "size": 40088,
 "status": "done",
 "type": "image/jpeg",
 "uid": "9c899f3c-692e-445e-b5dd-18a521adedb5",
 "url": "https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/881.jpg"
 }
 ],
 "addresses": [
 {
 "text": "11633 Andreane Ridges, Lindenhurst, NY 11529",
 "coordinate": [
 "40.789936704398265",
 "-73.92872385343622"
 ]
 },
 {
 "text": "11433 Kunze Islands, Lindenhurst, NY 11333",
 "coordinate": [
 "40.65814240336102",
 "-73.92500146534398"
 ]
 },
 {
 "text": "11553 Schmeler Vista, Massapequa, NY 11833",
 "coordinate": [
 "40.72293906461984",
 "-73.99654445094066"
 ]
 }
 ]
 },
 "amount": 5450,
 "createdAt": "2023-05-30T17:04:59.398Z",
 "products": [
 {
 "id": 32,
 "name": "Six inch Rotisserie Chicken",
 "isActive": true,
 "description": "The Football Is Good For Training And Recreational Purposes",
 "images": [
 {
 "url": "https://images.unsplash.com/photo-1556386734-4227a180d19e?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MTY0fHxmb29kfGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60",
 "name": "4c945640-b202-47c5-9460-fe37ea5331dc",
 "status": "done",
 "type": "image/jpeg",
 "uid": "fed829c6-0168-436c-a4c9-fa22e5670362"
 }
 ],
 "createdAt": "2022-09-19T04:55:06.053Z",
 "price": 1654,
 "category": {
 "id": 6,
 "title": "Incredible",
 "isActive": true
 }
 },
 {
 "id": 65,
 "name": "Jr Whopper",
 "isActive": true,
 "description": "The automobile layout consists of a front-engine design, with transaxle-type transmissions mounted at the rear of the engine and four wheel drive",
 "images": [
 {
 "url": "https://images.unsplash.com/photo-1465014925804-7b9ede58d0d7?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MTM5fHxmb29kfGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60",
 "name": "7012c944-114a-4f6d-a29c-12ec38d3603c",
 "status": "done",
 "type": "image/jpeg",
 "uid": "a77c9fab-2592-4fc9-a105-e7d220bbe7ef"
 }
 ],
 "createdAt": "2023-03-09T02:43:00.016Z",
 "price": 1845,
 "category": {
 "id": 7,
 "title": "Intelligent",
 "isActive": true
 }
 },
 {
 "id": 148,
 "name": "BBQ Chicken Flatbread",
 "isActive": true,
 "description": "The slim & simple Maple Gaming Keyboard from Dev Byte comes with a sleek body and 7- Color RGB LED Back-lighting for smart functionality",
 "images": [
 {
 "url": "https://images.unsplash.com/photo-1519708227418-c8fd9a32b7a2?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MTUwfHxmb29kfGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60",
 "name": "0cfee945-27aa-4269-a0d4-292fdd2515c2",
 "status": "done",
 "type": "image/jpeg",
 "uid": "0efc3b8c-12f5-43bc-a7de-637073b90166"
 }
 ],
 "createdAt": "2022-11-16T12:09:04.094Z",
 "price": 1951,
 "category": {
 "id": 10,
 "title": "Small",
 "isActive": true
 }
 }
 ],
 "status": {
 "id": 3,
 "text": "On The Way"
 },
 "adress": {
 "text": "11553 Schmeler Vista, Massapequa, NY 11833",
 "coordinate": [
 "40.72293906461984",
 "-73.99654445094066"
 ]
 },
 "store": {
 "id": 12,
 "title": "Geo Pike",
 "email": "Marge_Larson86@yahoo.com",
 "gsm": "(869) 599-6395",
 "isActive": true,
 "createdAt": "2023-04-28T21:44:06.948Z",
 "address": {
 "text": "11264 Rohan Oval, Massapequa, NY 11688",
 "coordinate": [
 "40.64496287697962",
 "-73.96098260334531"
 ]
 },
 "products": []
 },
 "courier": {
 "id": 28,
 "name": "Diana",
 "surname": "Kuhlman",
 "email": "Consuelo_Muller21@yahoo.com",
 "gender": "Male",
 "gsm": "(512) 987-8576",
 "createdAt": "2022-11-04T13:14:46.475Z",
 "accountNumber": 5622515347,
 "licensePlate": "HHR 659",
 "address": "11469 Friedrich Tunnel, Lindenhurst, NY 11617",
 "store": {
 "id": 5,
 "title": "Bechtelar Alley",
 "email": "Wilbert.Howe87@yahoo.com",
 "gsm": "(726) 014-0566",
 "isActive": true,
 "createdAt": "2023-03-29T22:30:49.016Z",
 "address": {
 "text": "11055 Langworth Hollow, Lindenhurst, NY 11923",
 "coordinate": [
 "40.69136794348759",
 "-73.94045368158224"
 ]
 },
 "products": []
 },
 "avatar": [
 {
 "name": "a56163e1-80a3-4aff-adf3-73722a2b678b",
 "percent": 100,
 "size": 40088,
 "status": "done",
 "type": "image/jpeg",
 "uid": "6a72468a-87ea-4beb-a05a-d66bd38e6f9b",
 "url": "https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/660.jpg"
 }
 ]
 },
 "events": [
 {
 "date": "2023-05-30T17:04:59.398Z",
 "status": "Pending"
 },
 {
 "date": "2023-05-30T17:05:59.398Z",
 "status": "Ready"
 },
 {
 "date": "2023-05-30T17:07:59.398Z",
 "status": "On The Way"
 },
 {
 "status": "Delivered"
 }
 ],
 "orderNumber": 930672
}
]
You must be logged in to vote

Replies: 1 comment

Comment options

Put your data into a nodes property.

const data = {
nodes: [],
};

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /