Next.js Discord

Discord Forum

Can't return object property when it is shown in the object

Answered
American black bear posted this in #help-forum
Open in Discord
Avatar
American black bearOP
I have a client component that posts data to an api onClick and awaits for response upon api request to update the State. I have done a console log of the 'post' object and it looks like the object is successfully set but when i logged the post.photo, it returns undefined even though we do have a photo in the post. Would you know what is the issue?
Image
Image
Answered by joulev & fuma pray for Schneider
Pretty sure it is post.post.photo
View full answer

2 Replies

Avatar
joulev & fuma pray for Schneider
Pretty sure it is post.post.photo
Answer
Avatar
American black bearOP
Thank you kind sir, you just saved me hours of endless troubleshooting