React does not render after changing the object in useState
After adding the item to the array, the list remains unchanged, although the object in the console already has a new item. The direct mutation of the array or object retains a reference, and React may skip the state update.
How to identify the source of the problem
Find push, splice or assign methods to properties performed directly on the state variable. Check if setState gets the same reference as before instead of a new array or object.
Compare the message from the console with the result of the production compilation and the condition after the page has been refreshed.
Repair steps
Apply a non-mutative update, e.g. setItems(prev => [...prev, newItem]), keeping record identifiers. For nested data, copy all changes to the object levels or use the proven immutable update mechanism.
How to Test Solution
After adding and removing the item, the view immediately updates and does not modify the historical version of the state.
Security and restrictions
Do not attempt to forceUpdate as a data mutation solution.