-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ ๐ Library ] ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ฆฌํฉํ ๋ง #155
Conversation
โ Deploy Preview for deluxe-otter-55aa15 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ต๊ฒฝ์ด ์๋ฒ์์ ์ํต๋ ์ด๋ฒ์ ํ๋ฒ๋ ์ฑ์ฅํ๊ฒ ๋ ๊ณ๊ธฐ๊ฐ ์๋๊ฐ ์ถ์ด! ๊ธ๊ตฌ ์ ๊ฑฐ ์ฝ์ ๋ง์ด์ฐํ๋๊ฑฐ ๋๋ ๊ณ์ ์ฐพ์๋ณด๊ณ ์ด๋ฐ์ !! ํน์๋ชจ ์ฐพ๊ฒ ๋ฐ๋ฉด ๊ณต์ ๋ถํํด!!
์ ๊ฒ ๋ณด๋๊น swr์์ ํค๊ฐ ์ ์ผํ ํค๊ฐ ์๋๋ฉด? ๋ฐ๋ณตํธ์ถํ๋ค๋๋ฐ useSWRInfinite์์ ์ด ํ์์ด ์๊ฐ๋ณด๋ค ๋ค๋ค ๋ง์ด ๋ํ๋๋๋ผ๊ตฌ! ์ฐจ๊ทผ์ฐจ๊ทผ ์์๋ณด์! ๊ณ ์ํด์จ !!
const getKey = (prevLastDate: number, allVoteInfo: AxiosResponse<EndedVoteInfo>) => { | ||
if (prevLastDate === 0) return `/vote/library/scroll/all?flag=${prevLastDate}`; | ||
if (allVoteInfo) return `/vote/library/scroll/all?flag=${allVoteInfo.data.dates[allVoteInfo.data.dates.length - 1]}`; | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ ์กฐ์ฟ ์!
@@ -7,15 +7,12 @@ import { picmeGetFetcher } from '../axios'; | |||
export const useGetMonthlyLibraryInfo = (date: number) => { | |||
const { data, isLoading, error, size, setSize } = useSWRInfinite<AxiosResponse<VoteInfo[]>>( | |||
(idx: number, monthlyVoteInfo: AxiosResponse<VoteInfo[]>) => { | |||
// date ๋ฐ์ผ๋ ค๊ณ ๋ฐ๋ก getKey ์ ์ธํ๊ฑธ ๋บ์ด!!!! | |||
if (idx === 0) return `/vote/library/scroll/month?flag=${0}&date=${date}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (idx === 0) return `/vote/library/scroll/month?flag=${0}&date=${date}`; | |
if (!idx ) return `/vote/library/scroll/month?flag=0&date=${date}`; |
์ด์ผ ํ๋ฉด ๋ฐ๋๊ฑฐ ์๋๊ฐ?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ฐ์ ! ๋ง๋ค! ๋ ๊น๋ํ๋ค! ๋ฐ๊ฟจ์ด์์ค
src/pages/Library.tsx
Outdated
@@ -45,15 +44,15 @@ const Library = () => { | |||
navigate('/home'); | |||
}} | |||
/> | |||
{allVoteInfoList.list.length !== 0 ? ( | |||
{allVoteInfoList.dateList.length !== 0 ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{allVoteInfoList.dateList.length !== 0 ? ( | |
{ allVoteInfoList.dateList.length ? ( |
๋ก ์ฐ๋ฉด ๋ ๊ฒ๊ฐ์์ฉ~!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ฐ์ํด๋ ! ๊ณ ๋ง์ด!!!
src/pages/Library.tsx
Outdated
<StEmptyView> | ||
<div> | ||
<IcEmptyLibrary /> | ||
<p>์์ง ๋ง๊ฐ๋ ํฌํ๊ฐ ์์ด์!</p> | ||
</div> | ||
</StEmptyView> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ฌ๊ธฐ์ ์๋งจํฑ ํ๊ทธ์ ๋ฐ๋ก ์คํ์ผ์ ์ ์ฉํด๋ ๋ ๊ฑฐ๊ฐ์๋ฐ ํ์์ div
๋ฅผ ์ค์ ๊ตฌ์ฑํ ์ด์ ๊ฐ ์์๊น?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์์ด์ฝ์ด๋ ํ
์คํธ๋ฅผ ํ ๋ฉ์ด๋ฆฌ๋ก ์ทจ๊ธํ๊ณ ์ถ์๋๋ด...!
๊ทผ๋ฐ ์๋ฃจ ๋ง๋๋ก ํ๋๊ฒ ๋ ๊น๋ํ ๊ฒ ๊ฐ์์ ๊ทธ๋ ๊ฒ ๋ฐ๊ฟ์ ์ ์ฉํ์ด! ๊ณ ๋ง์ด!!
@@ -37,7 +37,7 @@ export const getCurrentVoteDatailData = async (voteid: string | undefined) => { | |||
|
|||
export const getCurrentVoteData = async (resCursorId: number) => { | |||
try { | |||
const data = await client.get<AxiosResponse<VoteResultData>>(`vote/getCurrentVote/${resCursorId}`); | |||
const data = await client.get<AxiosResponse<VoteResultData>>(`vote/list/${resCursorId}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ฌ๊ธฐ ์ธ์ ์ด๋ฆ resCursorId
๊ฐ ๋๋ฒจ๋กญ์์๋ cursorId
์ฌ์ ๋๋ ๋จธ์ง์ปจํ๋ฆญํธ ํด๊ฒฐํ ๋ cursorId
๋ก ํด์ ๋จธ์งํ๋๋ฐ ์ด๋ค ์ด๋ฆ์ด ๋ ์ ํฉํ ๊น? ํต์ผํด์ผํ ๋ฏ!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๊ฑฐ ๋ด๊ฐ ๋ฆฌํฉํ ๋งํ ๋ถ๋ถ์ธ๋ฐ SWR๋ก ์ ์ฉํ๋ฉด์ ์ด ํจ์๋ ์์ด์ก์ด!! ใ ใ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๊ฑฐ ๋ด๊ฐ ๋ฆฌํฉํ ๋งํ ๋ถ๋ถ์ธ๋ฐ SWR๋ก ์ ์ฉํ๋ฉด์ ์ด ํจ์๋ ์์ด์ก์ด!! ใ ใ
์ํ ๊ตฟ ใ
<StVotingTitle>{voteData.title}</StVotingTitle> | ||
<StVotingDate> | ||
{time1}์ {time2}์ผ | ||
{createdMonth}์ {createdDate}์ผ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ช ํํ ๋ค์ด๋ฐ ๊ตฟ~
const handleModal = (prev: boolean) => { | ||
setIsShowing((prev) => !prev); | ||
}; | ||
|
||
const handleMoveResult = () => { | ||
const handleGoToResult = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ธฐ๋ฅ์ ๋ํด์ ๋ ๋ช ํํ๊ฒ ์์๋ณด๊ฒ ํ๋ ค๋ ์๋๊ฐ ์ข๊ตฐ์~!
์ผ๋ฌด์ง ๋ฆฌํฉํ ๋ง ๊ตฟ! SWR์ ํ์ด์ง๋ค์ด์
๊ธฐ๋ฅ ํ์ฉ์ ๋ํด์ ํ๋ฒ ๋ ๋ฐฐ์ฐ๊ฒ ๋๋ค |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ต๊ฒฝ์ด ๊ฐ๋ก์ธ๋ก ๋ฌดํ์คํฌ๋กค ๋ฆฌํฉํ ๋ง๊น์ง ํผ ๋ฏธ์ณค๋ค... useSWRInfinite๊น์ง ์ธ ์ ์๋ ์ฐ๋ฆฌ,,,, ์งฑ์ด์ผ,,,,
const handleDeleteVote = (id: string) => { | ||
deleteVote(id); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setState์ ๊ฐ์ด ๋ณ๊ฒฝ๋ ๋ฐ์ดํฐ๋ฅผ ์ ๋ฐ์ดํธํ๊ธฐ ์ํด์๋, mutate ํจ์๋ฅผ ์ด์ฉํ๋ฉด ๋๋ค.
mutateํจ์๊ฐ ํธ์ถ๋๋ฉด ํด๋น ์ํ๋ฅผ ์ฆ์ fetchํ๊ณ ๋ฐ์ดํฐ๋ฅผ ๊ฐฑ์ ํ๋ค.
๋ผ๊ตฌ ํฉ๋๋ฅ!! ๊ทธ๋ฆฌ๊ตฌ axios ์๋ฒํต์ ๋ถ๋ถ์ธ ๊ฒ ๊ฐ์๋ฐ async, await ๋ฃ์ด์ค์ผ ํ ๊ฑฐ๊ฐ์์ฉ!
const handleDeleteVote = (id: string) => { | |
deleteVote(id); | |
}; | |
const handleDeleteVote = async (id: string) => { | |
await deleteVote(id); | |
return mutate(); | |
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ผฌ๋ง์ด!! mutate SWR ๋๋ฌธ์ ์ค์ปท ๊ณต๋ถํด๋๊ณ ์ ์ฉ์ ๋ชปํ๋ค!ใ ใ ๋๋ถ์ ์ด์ ์ ์ธ ์ ์๊ฒ ๋ค ๋ฐ์ํด๋ !!!
import { picmeGetFetcher } from '../axios'; | ||
|
||
export const useGetMonthlyLibraryInfo = (date: number) => { | ||
const { data, isLoading, error, size, setSize } = useSWRInfinite<AxiosResponse<VoteInfo[]>>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1๏ธโฃ SWR์ ์ ์ฉํ๋ฉด์ ๊ฐ๋ก ๋ฌดํ์คํฌ๋กค ์์ดํ ๋ค์ state๋ก ๊ด๋ฆฌํ์ง ์๊ฒ ๋์์ด์!
๊ทธ๋์ ํฌํ ์ญ์ ํ ์๋ก๊ณ ์นจ์ ๋ฐ์์์ผ์ ์ญ์ ํ ๋ฐ์ดํฐ๊ฐ ๋ค์ ์ญ ๋ ๋๋ง๋๋๋ก ์ฒ๋ฆฌํ๋๋ฐ ์ด๊ฒ ์ต์ ์ธ์ง ์์ง ์ ๋ชจ๋ฅด๊ฒ ์ด์ ํ ๋ฒ ๋ด์ฃผ์๋ฉด ์ข์ ๊ฒ ๊ฐ์์!
-> ์ฐพ์๋ณด๋๊น SWR๋ก ์ํ๊ด๋ฆฌ๋ฅผ ํ๋ ค๋ฉด mutate
๋ฅผ ์ฌ์ฉํ๋ฉด ๋๋ค๊ตฌ ํ๋ค!
์ฑ๊ฒฝ์ด ๋ธ๋์น ๋ด ๋ก์ปฌ์์ ๋ฐ์์ ์์
ํด๋ดค๋๋ฐ ์๋ก๊ณ ์นจ ํ์ง ์๊ณ ๋ ์ญ์ ํ ๊ฑฐ ํ๋ฉด์ ๋ฐ๋ก ๋ฐ์๋๋๊ฑฐ ํ์ธ๋ผ์ suggestion์ผ๋ก ์์ ํ ๋ถ๋ถ ๋ฌ์๋์๊ฒ!!
์๊ฑฐ ์ฐธ๊ณ ํ์ด! 3. SWR๋ก ์ํ๊ด๋ฆฌ๊ฐ ๊ฐ๋ฅํ ๊น?
const { data, isLoading, error, size, setSize } = useSWRInfinite<AxiosResponse<VoteInfo[]>>( | |
const { data, isLoading, error, size, setSize, mutate } = useSWRInfinite<AxiosResponse<VoteInfo[]>>( |
setSize, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setSize, | |
}; | |
setSize, | |
mutate, | |
}; |
const createdAtStr = voteData.createdAt.toString(); | ||
const createdMonth = createdAtStr.slice(5, 6) === '0' ? createdAtStr.slice(6, 7) : createdAtStr.slice(5, 7); | ||
const createdDate = createdAtStr.slice(8, 9) === '0' ? createdAtStr.slice(9, 10) : createdAtStr.slice(8, 10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์น ํจ์ฌ ๋ช ํํด์ก๋น ๊ตฟ~!!
handleDeleteVote(id); | ||
setIsShowing((prev) => !prev); | ||
window.location.reload(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
window.location.reload(); |
:first-child { | ||
margin-left: 2rem; | ||
} | ||
:last-child { | ||
margin-left: 0; | ||
margin-right: 2rem; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๋ ๊ฒ ํด๋ฒ๋ฆฌ๋ฉด ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ํญ๋ชฉ์ด 1๊ฐ๋ฐ์ ์์ ๋ :last-child
๊ฐ ์ ์ฉ์ด ๋์ด์, margin-left๊ฐ 0์ด ๋๋ค ใ
ใ
!
๋๋ ๊ถ๊ธํด์ ์์ ํด๋ดค๋๋ฐ ํด๊ฒฐํ๊ฑฐ๊ฐ์์ suggestion์ผ๋ก ๋ฌ์๋ณผ๊ฒ!! ๋ฐ์ MonthVoting.tsx
์๋ ํ๋ ๋ ์์!!!
:first-child { | |
margin-left: 2rem; | |
} | |
:last-child { | |
margin-left: 0; | |
margin-right: 2rem; | |
} | |
margin-right: 1.521rem; | |
:last-child { | |
margin-right: 2rem; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ฐ์ดํฐ ํ๋์ผ ๋๋ฅผ ํ ์คํธ๋ฅผ ๋ชปํด๋ดค์๊ตฌ๋ ๋ด๊ฐ!! ์ญ์
margin-right: 1.521rem;
์ด๊ฑฐ๋ gap์์ ์ด ์ญํ ์ ํ๊ณ ์์ด์ ๋บ์ด! ์ด๊ฒ๊น์ง ๋ฃ์ผ๋ฉด ์ฌ์ด ๊ฐ๊ฒฉ์ด ๋ ๊ธธ์ด์ ธ์ใ
ใ
๊ณ ๋ง์ด ํ์ง ๋๋์ด~
|
||
width: 100%; | ||
margin-top: 1.7rem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๋ ๊ฒ ํ๋ฉด ๋ง์ง ์ด์ ํด๊ฒฐ๋๋๊ฑฐ๊ฐ์!!!
width: 100%; | |
margin-top: 1.7rem; | |
display: flex; | |
width: 100%; | |
padding-left: 2rem; | |
margin-top: 1.7rem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flex,margin์ ์์ ์์ด์ padding๋ง ์ ์ฉํด์จ! ๊ณ ๋ง์ด!
โ Deploy Preview for snazzy-seahorse-7d3184 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๊ณ ํ์ผ์~~
<StVotingPic src={voteData.url} onClick={handleMoveResult} /> | ||
<StVotingPic src={voteData.url} onClick={handleGoToResult} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๊ธฐ alt ํ๊ทธ ํ์์๋์??? imgํ๊ทธ์ onClick์ด๋ฒคํธ๋ฅผ ์ ์ฉํ๊ฑฐ๋ผ๋ฉด cursor : pointer
css๋ฅผ ํตํด ๋ง์ฐ์ค ์ปค์ ๋ชจ์์ ๋ณ๊ฒฝํด์ ํด๋ฆญ์ ํ ์ ์๋ค๋ ์ ๋ณด๋ฅผ ์ค๋ ์ข์ ๊ฑฐ ๊ฐ์ต๋๋ค~
}, | ||
); | ||
|
||
const parseResultList = data?.map((item) => item.data).flat(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flat ์์๋ ์ฒ์ ๋ดค๋๋ฐ ์ ์ฉํ๊ตฐ,,
๐ฅ Related Issues
resolved #145
๐ ์์ ๋ด์ฉ + ๐ฅ ํธ๋ฌ๋ธ์ํ
โ ์ฒ์์๋ SWR๋ง ์ ์ฉํ์๋๋ฐ, ์๋ฒ ํต์ ๊ฒฐ๊ณผ๊ฐ ์ข ์ข null๋ก ์์ ํ๋ฉด์ ํฌํ๊ฐ ๋ ๋๋ง๋์ง ์์์ต๋๋ค.
@Happhee ๋๋ถ์ useSWRInfinite๋ฅผ ์ ์ฉํ๊ณ , ํด๋น ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค.
userSWRInfinite์ ํฌํจ๋ ํจ์ getKey๋ ํ์ฌ ํ์ด์ง์ ์ธ๋ฑ์ค์ ์ด์ ํ์ด์ง์ ๋ฐ์ดํฐ๋ฅผ ๋ฐ๊ธฐ ๋๋ฌธ์ ์ฒซ ํธ์ถ๊ณผ ์ดํ ํธ์ถ, ๊ทธ๋ฆฌ๊ณ ๋ง์ง๋ง ํธ์ถ์ ๋ํ ๋ถ๊ธฐ์ฒ๋ฆฌ๊ฐ ๊ฐ๋ฅํฉ๋๋ค.
โ ๊ธฐ์กด : ์ธ๋ก API๋ฅผ ํธ์ถํ์ ๋ ๊ธฐ๋ณธ์ ์ผ๋ก ๊ฐ๋ก ๋ฌดํ์คํฌ๋กค์ ์ด๊ธฐ ๋ฐ์ดํฐ 5๊ฐ๊ฐ ์ธํ ์ด ๋๊ณ , ๊ทธ ๋ค์๋ถํฐ ์๋ก ๊ฐ๋ก ๋ฌดํ์คํฌ๋กค API๋ฅผ ํธ์ถํ๋ ํ์
โ ํ์ฌ : ์ธ๋ก API์์ ์ด๊ธฐ ๋ฐ์ดํฐ 5๊ฐ๋ฅผ ๋ณด๋ด์ฃผ์ง ์๊ณ ๋ ์ง๋ง ์ ๋ฌํด์ฃผ๊ณ , ๊ฐ๋ก ๋ฌดํ์คํฌ๋กค API์์ ์ฒ์์๋ flag=0๋ฅผ ๋ณด๋ด์ ์ด๊ธฐ๋ฐ์ดํฐ 5๊ฐ๋ฅผ ๋ฐ์์ค๋ ํ์
SWR์ ์ ์ฉํ๊ธฐ ์ ์๋ ์ธ๋ก ๋ฌดํ์คํฌ๋กค ์ปดํฌ๋ํธ์์ date๋ฅผ props๋ก ๋๊ฒจ์ฃผ์ด ๊ฐ๋ก ๋ฌดํ์คํฌ๋กค API์ ์ธ์๋ก ๋ฃ์ด์ฃผ์๋๋ฐ, SWR์ ์ ์ฉํ๋ props๋ก ๋๊ฒจ์ค ์ ๋ณด๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด ์ด๋ ค์์ ธ์ ์ด๋ป๊ฒ ๋ ์ง๋ฅผ ์ธ์๋ก ๋ฃ์ด์ค ์ ์์์ง ๊ณ ๋ฏผํ์ต๋๋ค.
โ @Happhee ์ ๋์์ผ๋ก ํด๋น ๊ตฌ์กฐ๊ฐ ๋ฐ์ดํฐ ํจ์นญ ๋ก์ง ์ ์์ฐ์ค๋ฝ์ง ์๋ค๋ ํ๋จ์ด ๋ค์ด ์๋ฒ์ ์์ ์์ฒญํ์ฌ ํด๊ฒฐํ์ต๋๋ค!
โ ๋ถ๋ชจ์ปดํฌ๋ํธ์ธ
MonthVoting.tsx
์์ ์์ ์ ํ์๋ก ๊ฐ๊ฒฉ์ ์กฐ์ ํ๋ ค๊ณ ๊ณ์ ์๋ํ๋๋ฐ, ๊ทธ๋ฅ ์์ ์ปดํฌ๋ํธ์ธEndedVoting.tsx
์์ ์๋์ ๊ฐ์ด ์ฒ๋ฆฌํด์ฃผ๋ ๊ฐ๊ฒฉ์ด ๊น๋ํ๊ฒ ๋ง๋๋ผ๊ตฌ์!โ PR Point
1๏ธโฃ SWR์ ์ ์ฉํ๋ฉด์ ๊ฐ๋ก ๋ฌดํ์คํฌ๋กค ์์ดํ ๋ค์ state๋ก ๊ด๋ฆฌํ์ง ์๊ฒ ๋์์ด์!
๊ทธ๋์ ํฌํ ์ญ์ ํ ์๋ก๊ณ ์นจ์ ๋ฐ์์์ผ์ ์ญ์ ํ ๋ฐ์ดํฐ๊ฐ ๋ค์ ์ญ ๋ ๋๋ง๋๋๋ก ์ฒ๋ฆฌํ๋๋ฐ ์ด๊ฒ ์ต์ ์ธ์ง ์์ง ์ ๋ชจ๋ฅด๊ฒ ์ด์ ํ ๋ฒ ๋ด์ฃผ์๋ฉด ์ข์ ๊ฒ ๊ฐ์์!
2๏ธโฃ ์ฝ๋๋ฅผ ์ต๋ํ ์ ๋ฆฌํ๋ค๊ณ ํ๋๋ฐ ์์ง ์ต๋ํ cleanํ์ง ์ ๋ชจ๋ฅด๊ฒ ์ด์ ํ ๋ฒ ๋ด์ฃผ์๋ฉด ๊ฐ์ฌํ๊ฒ ์ต๋๋ค ๐๐ป
3๏ธโฃ SWR ํธ์ถ ์ด์
โ ์๋จ ์ฌ์ง์ด ์ธ๋ก ์คํฌ๋กค์ ์ฒ์ ํธ์ถํ๊ณ ๊ทธ ๊ฒฐ๊ณผ๋ฅผ ์ฝ์์ ์ฐ์์ ๋์ธ๋ฐ์, ๋ณด์๋ ๊ฒ์ฒ๋ผ ํธ์ถ์ด ๋ณต์๋ก ์ด๋ฃจ์ด์ง๊ณ ์์ต๋๋ค.
SWR ๊ณต์ ๋ ํฌ์งํ ๋ฆฌ์ ์ด์๋ก ์ฌ๋ผ์จ ๊ธ [SWRInfinte bug]: repeated api calls for initial page index ์ ๋ณด๋ useSWRInfinite ์์ฒด์ ๋ฌธ์ ์ธ ๊ฒ ๊ฐ๊ธฐ๋ ํ๋ฐ, ์์ง ์์ ํ ํด๊ฒฐ๋ฐฉ๋ฒ์ ์ฐพ์ง ๋ชปํ์ต๋๋ค!๐ญ
๐ ์คํฌ๋ฆฐ์ท
2023-02-09.10.11.13.mov