*This is how i make the api request and get the response i only uploaded small parts to keep the question simple
const Invoices = ()=> {
const [invoices,setInvoices] = useState([]);
useEffect(()=>{
getInvoices();
},[])
const getInvoices = async () =>{
try{
await axios.get("http://localhost:8000/api/invoices").then((response)=>{
console.log(response.data)
const res = response.data
setInvoices(res);
console.log("length",invoices.length);
})
}catch(err){
console.error(err);
}
}
*and here is how i try to display it
<tbody>
{invoices.map((invoice,index) => {
return(
<tr key={index}>
<td>{invoice.N_FAC}</td>
<td>{invoice.CODE_CLI}</td>
<td>{invoice.CODE_WAREH}</td>
<td></td>
<td></td>
<td><input type="date"onChange={setD}></input></td>
<td><a href="#" onClick={() => hanldeClick(invoice)}>Edit</a></td>
</tr>
)
})}
</tbody>
- in the console i get back 3 arrays and each one of them containing about ~10000 objects *i am new to react so any help would be appreciated