Closed bostonbachexchange closed 2 years ago
If you take out user
from the props destructuring, is it still throwing an error? I'm trying to see if this is specific to user
or if it's being weird with all the props.
If I take user out of the line it says user is undefined.
Yes that happened because you are trying to use user
in other functionality on the page. Can you comment that functionality out for a sec so you can test this issue with props?
Not permanently of course just trying to isolate one part so we can test it
If I take out user it goes to the next prop: TypeError: Cannot destructure property 'message' of 'props' as it is undefined.
solved - calling the EditCommentModal
in the onClick
function instead of the updating the setCommentModal
state to true
I'm getting the create comment form instead of the update comment form as a modal
What stack are you using?
MERN
What's the problem you're trying to solve?
When I click on the button to show the edit comment model, the app crashes the browser shows: TypeError: Cannot destructure property 'user' of 'props' as it is undefined.
Post any code you think might be relevant (one fenced block per file)
If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?
When I click on the button to show the edit comment model, the app crashes the browser shows: TypeError: Cannot destructure property 'user' of 'props' as it is undefined.
What is your best guess as to the source of the problem?
I am passing user into Edit Comment Modal, I am not too sure
What things have you already tried to solve the problem?
compared to NewCommentModel console.log user deleting user from props show user undefined
Paste a link to your repository here https://github.com/bostonbachexchange/project_4_Client https://github.com/bostonbachexchange/project_4_API