생활
React javascript Promise 질문 드립니다.
아래처럼 사용하면 가능한데 혹시 then 밖으로 return 할 수 없을까요?? ㅠ.ㅠ 불가능하겠죠...? ㅠ
help(data).then(res=> { console.log(res) });
const help =(data) => { return axios.get( 'URL',{ params: { data, } } ).then(res => res.data) .catch (err => console.error(err)) }1개의 답변이 있어요!