반환문은 한 줄로? #5
Unanswered
SanginJeong
asked this question in
질문
Replies: 2 comments 2 replies
-
의견
질문
|
Beta Was this translation helpful? Give feedback.
1 reply
-
의견
질문
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
1주차 스터디에서 JSX 반환문에서 반환문을 한 줄로 표현하는 방법과 소괄호로 묶는 방법에 대한 의견
CASE 1: 한 줄로 반환하기
CASE 2: 소괄호로 묶어서 여러 줄에 걸쳐서 반환하기
저는 간단한 컴포넌트여도 아래와 같은 이유로 2번 방식으로 선언하는 것을 선호합니다.
1. 확장성이 용이합니다.
2. file changed 관점에서도 리뷰하기에 편리합니다.
CASE 2에 비해서 CASE 1은 가독성이 좋으며, 불필요한 fragment를 생성하지 않는다 라는 관점에서 장점이 있습니다.
어떻게 생각하시는지 궁금합니다
Beta Was this translation helpful? Give feedback.
All reactions