Skip to content

How to access a nested child object in Table.Column's prop property? #616

Answered by harshcut
sesto-dev asked this question in Q&A
Discussion options

You must be logged in to vote

You could use the map function to create a new array, then pass the new array to the data prop.

const fetchData = [
  { name: "Item 01", stats: { average_price: "13.20" } },
  { name: "Item 02", stats: { average_price: "17.50" } },
];

const newData = fetchData.map((item) => ({
  name: item.name,
  average_price: item.stats.average_price,
}));

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sesto-dev
Comment options

Answer selected by sesto-dev
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