Uncaught TypeError: Cannot read properties of undefined (reading 'text')

위와 같이 오류가 노출었는데 BucketDetail.js의 27번째 줄에서 오류가 발생되었다.
if (bucket_obj[0].text.trim() === "") {
bucket_text = "";
} else {
bucket_text = bucket_obj[0].text;
}
bucket_obj[0] 자체가 값이 없어서 오류가 발생, 삭제를 진행하기 위해 삭제 진행 후 history.goBack() 함수를 넣었으나,
옵셔널 체이닝(OptionalChaining)을 이용하여, return 시켜 줬더니 Tada! 해결되었다.!
const bucket_text = bucket_obj[0]?.text;