React UI is not getting updated on the last value deletion, although it’s fetching the updated value from the API.
I’ve got a table of various entries, and on deleting any entries except the very last entry in the table, the UI is getting rendered with the updated entries, but unfortunately It’s not working on the very last entry.
I tried looking at the useEffect hook, but only with the last value/entry, it’s not working. How can I fix it?
Edits:-
I’ve a table of data, and on deleting individual data, the UI is getting rendered and re-populated, but when I delete the Very last one, it’s not getting updated on the UI, although the (BackEnd)network tab has updated information
And for the very last one, I’m looking for a fix.
Hope it’s enough descriptive now. Thank You. I’m looking forward to hearing from You..Please consider the attached image, here there are two entries, if I wish to delete any one of them through the checkbox, it would work fine, updates the UI as well, but if I delete the very last one, the UI won’t be updated.
I tried useEffect and useState to fix the non-updation of state after the very last element deletion.
I’m expecting the UI should show the changes which is already coming from the BE.
Ankit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1