Thank you the () and the {} seem to be the problem,
I would also like to know how to deconstruct a Axios response,
I know how to do this with fetch but not with Axios. I am looking on google for the past couple of hours and i cannot seem to figure it out, i hope you can help me with that as well.
I have created a error propert in hte custom hook as wel and it does not show any errors, when i do console.log(“data”, data) its shows the object. when i do console.log(“data”, data.name) its shows : data undefined. i have had the same problem with fetch but that has been solved with: a code simulair to this:
Are you sure you are reading the shape of the object correctly? I don’t see how you can have the data object but not the properties on it. Post the object you get back so we can see it.
Also, can you post the backend code you use for the response? I assume you are using Expressjs for the backend? I don’t know why you would res a plain object why not use res.json() on the backend?
I think we might have to see your code in more detail. Do you have a Github repo you can link to?
Just FYI, I’m about to go off, I need to make some food. Maybe someone else can help you.