분류 전체보기
-
[git] 팀 프로젝트를 하기 위한 git 사용 전략프로그래밍 2024. 4. 18. 22:04
개요 - Branch 전략을 정하자 (Git Flow vs Github Flow) - Github를 이용한 칸반보드 - 코드리뷰 방법 - 문서 관리 with Wiki 팀 프로젝트를 진행하면서 Github를 단순히 Repo만 공유하는 느낌으로 사용한단 느낌을 받았다. 프로젝트의 Tab만 봐도 Issues를 비롯해 여러가지 기능이 많고 우측의 Nav만 봐도 여러가지 할 수 있을 것 같다는 생각이 들었기에 어떻게 활용을 잘 할 수 있을까를 고민하다 한번 정리를 해보았다. ✅ Branch 전략 Github를 올바르게 사용하기에 앞서 Branch 전략를 어떻게 가져갈지에 대해서 정해야 한다. 이름에서 알 수 있듯이 branch의 네이밍은 어떻게 하고 각각의 branch를 어떤식으로 사용하고 merge를 어떻게 할..
-
[Typescript] Generic과 forwardRef프로그래밍 언어/TypeScript 2024. 4. 16. 11:29
개요 1. 제네릭함수와 forwardRef의 문제점 2. 해결 방안 ✅ 제네릭함수와 forwardRef의 문제점 📦 기본적인 예제 (Table) const Table = (props: { data: T[]; renderRow: (row: T) => React.ReactNode; }) => { return ( {props.data.map((item, index) => ( ))} ); }; 위 예제는 간단히 제네릭함수를 통해서 구현된 Table이다. 현재 Table 컴포넌트를 사용하는 것을 통해서 어떻게 추론이 되는지 알아보겠습니다. { (parameter) row: string return {row}; }} />; 여기서 알 수 있듯이 data로 전달된 Array형태에서 타입이 추론이 되고, 그 추론된 타..
-
[BOJ - Silver 5] 11866 요세푸스 문제 0알고리즘 2024. 4. 3. 09:28
❓문제 설명 구현문제 순열을 구하는 문제로 N명이 원을 이루고 있을 때 K번째 순서를 계속해서 제거해 나가는 방식이다. 최종적으로 를 구하면 된다 ✅ 문제 해결 배열에서 특정 K의 배수에 해당하는 인원을 제거하고 그 이후로 다시 K를 세면서 계속 제거를 하는 방식이 필요했다. 처음에 계속 문제를 풀려고 했는데 제대로 구현이 안되서 참고를 하여 구현을 하게 되었다. const fs = require("fs"); const [n, k] = fs .readFileSync("/dev/stdin") .toString() .trim() .split(" ") .map(Number); const solution = (n, k) => { const people = Array.from({ length: n }, (_, i..
-
[React] useLayoutEffect의 활용프로그래밍/React 2024. 4. 2. 20:58
개요 1. useLayoutEffect 2. Usage 3. useLayoutEffect의 성능저하 4. SSR에서 사용이 가능한가? ✅ useLayoutEffect란? 📦 useLayoutEffect(Setup, dependencies?) 브라우저가 화면을 다시 채우기 전에 실행되는 useEffect이며, 성능 저하를 유발할 수 있어 가급적 useEffect를 사용할 것을 공식문서에서는 권장하고 있다. 컴포넌트가 DOM에 추가되기 전에 React는 setup함수를 실행한다. 리랜더링 시: (클린업함수가 정의되어있을 시)cleanup 함수(이전 값ㅋ) → setup함수(새 값) → ( 컴포넌트가DOM에서 제거되기 전) cleanup 함수 실행 의존성을 이전 값과 비교하여 실행할지 말지를 결정하며, 인수가..