로직 종류에 따라 합쳐진 함수 쪼개기 | Frontend Fundamentals #76
Replies: 2 comments 1 reply
-
글 잘 읽었습니다! 혹시 위 예제 코드에서 다음과 같이 수정해야 하는 것은 아닌가요? import { useQueryParam } from 'use-query-params';
export function useCardIdQueryParam() {
const [cardId, _setCardId] = useQueryParam('cardId', NumberParam);
const setCardId = useCallback((cardId: number) => {
_setCardId(cardId, 'replaceIn');
}, []);
return [cardId ?? undefined, setCardId] as const;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
로직 종류에 따라 합쳐진 함수 쪼개기 | Frontend Fundamentals
변경하기 쉬운 프론트엔드 코드를 위한 지침서
https://frontend-fundamentals.com/code/examples/use-page-state-readability.html
Beta Was this translation helpful? Give feedback.
All reactions