here is my code
const { data , isLoading, ...} = useInfo();
console.log(data?.data.payload.info);
‘useInfo’ is react-query hook i made.
data?.data.payload.infois is too long..
i want to use data name with no deps
Is there a way to use it as below?
console.log(info) => returns data only i need
teach me the way and sorry for my poor English 🥲🥲🥲🥲
>Solution :
Destructure the info property of data.data.payload.
const { info } = data?.data.payload;