Open jacobways opened 2 years ago
const openApplicantList = (jobId, idx) => { axios.get(`http://localhost:5000/applicant/${jobId}`, {withCredentials: true}) .then((res)=> { setApplicantList(applicantList[idx] = [res.data.data]) }) }
원인 : 리액트에서 bracket notation은 배열에 값을 할당하는 문법
해결방안 : object.assign 또는 객체 구조분해 할당을 사용하여 객체에 값을 추가
setApplicantList({ ...applicantList, [idx]: res.data.data });
문제 상황 및 에러 로그
원인 및 해결방안
원인 : 리액트에서 bracket notation은 배열에 값을 할당하는 문법
해결방안 : object.assign 또는 객체 구조분해 할당을 사용하여 객체에 값을 추가