[20220626 S]

devbit4 [front-end developer]·2022년 6월 26일
0

TIL

목록 보기
75/163

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>
})}

custom query hook

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

  • plan for next week
  • finish watching videos
  • search for M
profile
제대로 꾸준하게 / 블로그 이전 => https://dailybit.co.kr

0개의 댓글