◾️ component did mount only : useEffect(()=>recvData();},[]);
function useFetch(url) {
const [payload,setPayLoad] = useState(null);
const recvData = async() => {
try{
const{data} = await Axios.get(url):
setPayload(data);
}
catch{}
finally {}
}
useEffect(() => {
recvData();
}, []);
return { payload };
}