I am using React Table and recently I got into an issue of not being able to search nested array of objects in my column data! This is my code so far.
{
Header: "competitors",
accessor: "competitors",
Cell: ({ cell }: { cell: CellProps<TableInstance> }) => (
<div className="flex flex-wrap gap-y-1 items-center">
{cell.value.map((competitor: Competitor, i: number) => {
return (
<div key={i}>
<span
key={i}
className="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800 mx-1"
>
{competitor.name}
</span>
</div>
);
})}
Basically competitors is an array of object and in the cell, I change to values to just its name. Do help thank you! :)