날짜 : 2023-10-24 14:01Permalink

태그 : #프로그래밍언어Permalink


내용Permalink

async awaitPermalink

asyncPermalink

  • 비동기 함수의 시작을 명시하는 키워드

awaitPermalink

  • 함수의 종료까지 line 실행을 기다리는 키워드

사용법Permalink

  <button
	onClick={async () => {
	  try{
		const response = await axios.get(URL);
		setData(response.data);
	  }
	  catch (error){
		console.error(error);
	  }
	  
	}}
>
{: .notice--info}
	데이터패치
  </button>


연결문서Permalink

댓글남기기