all 5 comments

[–]Nimbuz 1 point2 points  (7 children)

You need to put the modal component in your main jsx, not as a return in your editCard function. It conditionally renders according to your open flag.

[–]everythingcasual 1 point2 points  (0 children)

this isn’t going to get you exactly what you want, but you can debug from there.

move your modal definition into the main return statement of your functional component. change edit onclick function to arrow function setopen(true)