I can't display the content of my json file in my table. I get the headers but nothing in cells.
Here is my code:
import Table from './Table'
import Menu from "./menus.json"
export default function Display() {
const [menu, setMenu] = useState([Menu]);
const data = useMemo(() => [
{
Header: 'Id',
accessor: menu.id,
},
{
Header: 'Title',
accessor: menu.title,
},
{
Header: 'Invited',
accessor: menu.invited.name,
},
{
Header: 'Price',
accessor: menu.price,
},
], [])
return (
<Table data={menu} columns={normalizeData(data.result)}>
)
}
Just before the return i tried an Object.keys(data).map((key) => ({id: key,})); but doesn't work.
Thanks for your help !