Material ui table accept data in this format.
rows: [
createData(1, "dashboard", "details"),
createData(2, "product", "product details"),
].sort((a, b) => (a.id < b.id ? -1 : 1))
And the response from API that I store in state is like
rows: Array(2)
0: {id: 1, category_name: "dashboard", category_details: "details"}
1: {id: 2, category_name: "product", category_details: "product details"}
length: 2
__proto__: Array(0)
So how to assign the response from json array to material ui table in react?