Skip to content
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

[10장][동호] 리액트 17과 18의 변경 사항 살펴보기 #46

Open
khakhiD opened this issue May 16, 2024 · 3 comments
Open

[10장][동호] 리액트 17과 18의 변경 사항 살펴보기 #46

khakhiD opened this issue May 16, 2024 · 3 comments
Assignees

Comments

@khakhiD
Copy link
Collaborator

khakhiD commented May 16, 2024

퀴즈

리액트 서버 사이드 렌더링의 관점에서 리액트 18 버전에서 추가된 renderToPipeableStream이 renderToNodeStream과 다른 점을 간단히 서술해주세요.

정답

renderToNodeStream은 무조건 렌더링을 순서대로 해야 하고, 순서에 의존적이었기에 이전 렌더링이 완료되지 않으면 이후 렌더링도 끝나지 않는 문제가 있었습니다.
-> renderToPipeableStream을 사용하면 순서나 오래 걸리는 렌더링에 영향받을 필요 없이 빠르게 렌더링을 수행할 수 있게 됩니다.

댓글 작성법

(다음과 같이 답을 작성해 댓글로 달아주세요)
<details>
<summary>정답</summary>
<div markdown="1">
정답 설명
</div>
</details>

@khakhiD khakhiD added the 10장 label May 16, 2024
@khakhiD khakhiD self-assigned this May 16, 2024
@GBAJS754
Copy link
Contributor

GBAJS754 commented May 17, 2024

정답
(몰라서 그냥 책보고 적어요ㅠ) renderToNodeStream는 무조건 렌더링을 순서대로 해야하고 그 순서에 의존적이기 때문에 이전 렌더링이 완료되지않는다면 이후 렌더링도 끝나지 않는다. 반면 renderToPipeableStream는 순서나 오래걸리는 렌더링에 영향을 받지않는다.

@leeminhee119
Copy link
Collaborator

정답

renderToPipeableStream을 쓰면 서버에서 Suspense를 통해 빠르게 렌더링이 필요한 부분을 먼저 렌더링하고 여유 있는 애들은 나중에 렌더링하는 것이 가능하다. 따라서 오래 걸리는 렌더링을 기다릴 필요가 없어진다. renderToNodeStream은 무조건 렌더링을 순서대로 해야했기 때문에 오래 걸리는 렌더링으로 인해 이후 순서의 렌더링들이 계속 기다리게 되는 문제가 있다.

@jkea1
Copy link
Collaborator

jkea1 commented May 17, 2024

정답
renderToNodeStream는 무조건 렌더링을 순서대로 해야 하고 그 순서에 의존적이기 때문에 이전 렌더링이 완료되지 않는다면 이후 렌더링도 끝나지 않는다는 문제가 있었다. 하지만 renderToPipeableStream을 활용하면 순서나 오래 걸리는 렌더링에 영향받을 필요 없이 빠르게 렌더링을 수행할 수 있게 된다.

@jkea1 jkea1 removed the 진경 label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants