cat

클린코드

클린코드

리액트 클린 코드 - (1)

1. 하나의 상태만을 위한 렌더링 true일 때만 render하고 false일 땐 render하고 싶지 않을 때, 삼향연사자보다는 &&연산자로 나쁜 예 : import React, { useState } from 'react' export const ConditionalRenderingWhenTrueBad = () => { const [showConditionalText, setShowConditionalText] = useState(false) const handleClick = () => setShowConditionalText(showConditionalText => !showConditionalText) return ( Toggle the text {showConditionalText ? The ..

여행 가고싶다
'클린코드' 카테고리의 글 목록