Why can't I get it as an object (abonnes) from result Getelementbyid? I get the element on JSON.
function Abonnes() {
const [abonnes, setAbonnes] = useState();
const getOneAbonnes = (id) => {
Axios.get(`http://localhost:4000/api/getonea/${id}`).then((response) => {
setAbonnes(response.data);
console.log(abonnes); // undefined
});
};
}