Hey, so I’m encountering this issue in a few of my CRUD apps and I can’t pinpoint why. I’m able to create a list of items by posting them from a form. MongoDB Atlas is connected and I can GET and POST. However, when I try to DELETE an item, it will always delete the first one in the list, rather than the one I’m selecting.
I posted on stackoverflow and someone suggested my React keys may not be right but they seem to be (I’m using map to loop through the items).
I was wondering if it’s because I’m using uncontrolled React forms with refs, instead of controlled. But I tried changing one of them; this also didn’t work.
So now I’m wondering if using findOneAndDelete() with mongoose for the DELETE request is correct or not.
Anyone else run into this problem before? The project is here - https://mealtracknfind.glitch.me/