i have this component in react
export default function CambiosEnArchivo() {
const [response ,setResponse]= useState([]);
useEffect(() => {
axios
.get(url + "/datosarchivotexto")
.then((data) => {
setResponse(data)
})
.catch((error) => {
console.log(error.message);
},[]);
});
return (
<div>
<table className="table ">
<thead>
<tr>
<th>Nombres</th>
<th>Valor1</th>
<th>Valor2</th>
<th>Valor3</th>
</tr>
</thead>
<tbody>
{response.map((dato) => {
return <tr><td>{dato.Nombre}</td><td>{dato.Valor1}</td><td>{dato.Valor2}</td><td>{dato.Valor3}</td></tr>
})}
</tbody>
</table>
</div>
);
}
I'm trying to fetch data from an api an render it in a table
Page is not rendering as this error follows up:
the api is returning this