Hello i've been trying to map this however i keep getting the error : Cannot read properties of undefined (reading 'filter')

this is the code i'm using to fetch the data
const [data, setData] = useState([]);
const [filters, setFilters] = useState(data);
const getProduct = async () => {
const response = await fetch(Data source (cant share it));
if(componentMounted){
setData(await response.clone().json());
setFilters(await response.json());
}
return () => {
componentMounted = false;
}
}
useEffect(() => {
getProduct()
// eslint-disable-next-line
}, [])
and this is how i'm mapping the data:
{filters?.list.filter((product) => product.id === id).map((product) => (
<div className='product-bigger-wrapper'>
<div class="product-list-wrapper">
<div className="product-detail-container">
<div>
<div className="image-container">
<img src={product.image} className="product-detail-image" alt=""/>
</div>
</div> .... }
Please Note that everything worked fine before adding the count and the list to the api
filtersis set todata, anddatais[]. At which pointfilters?.listisundefined, because the?.only checksfiltersis defined (which it is, as an empty array that doesn't have a.listproperty) You might want to check that.listis defined as well (filters?.list?.filter())