분류 전체보기
-
[리액트를 다루는 기술] 랜더링 최적화프로그래밍/React 2023. 6. 17. 00:24
11강 간단요약! 리스트가 랜더링을 하는 과정에서 불필요한 Component까지 랜더링이 되는 현상으로 인해 Lag현상이 생기게 되는데 이러한 현상을 막기위해 최적화를 통해서 부하를 줄이고 줄여서 클라이언트를 좀 더 빠르게 쓸 수 있게 해주는 것들에 대한 이야기 첫번째! func() 과 func 의 차이를 알아보자! 인자로써 받은 func() 과 func는 실제로 클라이언트가 랜더링 될 때마다 실행하는지 처음 랜더링 될 때 실행되고 고정인지에 대한 차이가 있다 자세히 무슨 원리일까 알아보자! 두번째! React.memo를 이용해서 감싸보자! 정말 간단하게 마지막 export 하는 부분에서 React.memo(ComponentName) 을 하고 React를 import 하는 것만으로 랜더링을 안하도록 만든..
-
알고리즘 Day-1알고리즘 2023. 6. 16. 19:27
알고리즘을 풀면서 헷갈리는 개념에 대해서 다시 한번 적어 보자! 문자열을 반복하는 방법 : string.repeat(count) 아래 예제를 통해서 반복되는 개념을 다시 한번 상기해보자 https://programmers.co.kr/learn/courses/30/lessons/12969 슬라이싱 : slice() 두 정수 사이의 합 : Math.min() Math.max() Math.abs() 양 끝의 합 * (수의차 + 1) / 2 이렇게 계산하는 방식이 너무 수학적 계산이라서 생각도 못했음 ㄷ.. Number()를 써서 반환하는 값 : 숫자가 아닐 시에는(문자) NaN이 출력 프로그래머스에서는 null로 표시가 되어있어서 NaN이라는 것 찾는데 좀 고생 했음 filter를 통해서 차집합 교집합 이런거..
-
async /await 에 대하여네트워크/CS Study 2023. 6. 14. 23:14
1. 사용하는 이유 비동기 처리를 하는 가장 기본적인 call back 함수를 이용한 처리와 promise 객체를 이용한 처리가 단점이 많다. promise 객체를 더욱 더 가시성 좋게 사용하기 위해 사용합니다 promise와 callback의 단점 1. 보기에 너무 나쁘다 call back 지옥 보면 토나오는 모양새이고 promise 또한 then으로 병렬적으로 쓰여진 것도 에러가 발생했을 때 찾기 좀 힘들고 들여쓰기가 많이 들어간다면 정신건강에도 나쁘다. 2. catch() 메서드를 사용해서 에러에 대해서 예외처리를 할 때 동기코드와 비동기코드가 섞여 있으면 누락이 있거나 난해해지는 경우가 있다. 그래서 async/await은 promise를 이용한 비동기처리의 불편함을 개선하기 위해서 ES7에서 새..