running into an error that I can't seem to fix. When I try to vote on a question, I'm getting the following error message: "Cannot read properties of undefined (reading 'id')". Here's the relevant code:
{question && question.id && (
<div key={question.id}>
<VoteForm question={question} onVote={onQuestionUpdate} />
</div>
)}
this all component https://pastebin.com/C5SuEgDr
from postman can see the img
I suspect the issue might be with the question prop not being passed correctly, but I'm not sure how to fix it. Can someone help me understand what's going wrong and how to solve it?
Thanks in advance!
is it worked?
no maybe i will change from backend
Обсуждают сегодня