예제 코드 5.5 Note를 제거하기 전에 먼저 렌더링한다
let secondsLeft = 5 let interval = setInterval(() => { if (secondsLeft == 0) { ReactDOM.render( <div> Note was removed after {secondsLeft} seconds. </div>, document.getElementById('content') ) clearInterval(interval) } else { ReactDOM.render( <div> <Note secondsLeft={secondsLeft}/> </div>, document.getElementById('content') ) } secondsLeft-- }, 1000)