listing nested data
@kapa.ai hi there am trying to list data from an api response and the data that am trying to list is nested in the first record ... how to do that?
useList hook. This hook allows you to dynamically fetch data and also allows you to filter, sort, and paginate any data retrieved from an API. data is the result of an API call, and isLoading helps in rendering useful information to the user before the results are available. users object and each user has an object, you can access the of the first user's address like this: .useTable hook from Refine. addressstreetdata[0].address.street"yourResourceName""yourResourceName"TableTable.ColumndataIndex"address.street""address.city""address.zipcode"useTable()useTable({ resource: "yourResourceName" })const { data, isLoading } = useList({
resource: "yourResourceName",
});import { useTable, List } from "@refinedev/antd";
import { Table } from "antd";
export const UserList = () => {
const { tableProps } = useTable();
return (
<List>
<Table {...tableProps} rowKey="id">
<Table.Column dataIndex="address.street" title="Street" />
<Table.Column dataIndex="address.city" title="City" />
<Table.Column dataIndex="address.zipcode" title="Zipcode" />
</Table>
</List>
);
};