From dc1edd613c302394d6c70e133c7f2649d01f2756 Mon Sep 17 00:00:00 2001 From: yongsk0066 Date: Mon, 27 May 2024 00:26:53 +0900 Subject: [PATCH] =?UTF-8?q?=EB=82=B4=EC=9A=A9=20=EB=B3=B4=EC=B6=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/content/blog/React_Compiler_2.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/content/blog/React_Compiler_2.mdx b/src/content/blog/React_Compiler_2.mdx index 1a614a9..80a901a 100644 --- a/src/content/blog/React_Compiler_2.mdx +++ b/src/content/blog/React_Compiler_2.mdx @@ -786,6 +786,12 @@ expect(root).toMatchRenderedOutput( // 렌더링 결과 확인 플래그가 활성화되어 있다면, 이전에 계산된 데이터를 재사용하기에 로그 없이 렌더링이 완료된다.\ 하지만 비활성화되어 있다면, 이전에 계산된 데이터를 재사용하지 않기에 'Some expensive processing... [A2]'가 찍히게 된다. +그렇게 `Data` 컴포넌트는 `A2B2`를 반환하게 된다. + +비활성화되어있으면 총 3번의 비싼 계산이 일어나게 된다.\ +하지만 활성화되어있으면 1번의 계산으로 끝난다. 꽤나 큰 차이이다. \ +현재는 false로 되어있지만, 추후 true로 변경된다면 한차례 더 성능이 좋아질 것이다. + 자 이렇게 이제 테스트 코드를 통해서 까지 `useMemoCache`의 동작을 확인해보았다. ### 마치며