Today is HAPPY Sunday👋
The weather is so hot and humid🌂
귀여운 보리가 보고싶은 일요일이군
{onSuccess,
onError,
select: (data)=>{
const superHeroNames = data.data.map((hero)=>hero.name)
return superHeroNames
}}
{data.map((heroName)=>{
return <1div key={heroName}>{heroName}</1div>
})}
const fetchSuperHeros = ()=>{
return axios.get(url)
}
export const useSuperHerosData=(onSuccess,onError)=>{
return useQuery('super-heros',fetchSuperHeros,{
onSuccess,
onError,
select:(data)=>{
const superHeroNames = data.data.map(hero->hero.name)
return superHeroNames
}
})
}
const {isLoading,data,isErro,error,isFetching,refetch}=useSuperHerosData(onSuccess,onError)
TODO