[JS/React] 삼항연산자 조합한 조건부 랜더링

hyeonze·2022년 1월 18일
0

일반적 조건부 랜더링

{arr && arr.map(el => {/})

삼항연산자 활용 : fetch된 내용이 존재할 때만 랜더링해주세요

const arr = [1, 1, 1];

arr?.forEach(el => console.log("출력중"))
profile
Advanced thinking should be put into advanced code.

0개의 댓글