Answer the question
In order to leave comments, you need to log in
Array element is not deleted after application restart. How can I do that?
1. There is an application written in React and consisting of several pages. 2. The application receives an array of data (including cards) about movies on the movies page. 3. It is possible to save the received data. 4. Saved movie cards are displayed on the movies page as cards that have changed the fill of the like icon. 5. Saved cards are also displayed on the saved-movies page. 6. You can remove cards from both pages. 7. The problem is that after reloading the application, deletion is only possible from the saved-movies page. 8. The reason for this behavior is that the saved movies come from MongoDB with the _id assigned by the database, and it is for this _id that the movies are deleted. 9. Data about movies that come from a third-party service on the movies page contains its own id, which is just a serial number in the database. 10. The question is how to pass the _id created by MongoDB for the saved movies to the movies on the movies page marked as saved so that deletion is also possible from this page. I can attach code if needed. At the moment it is not clear (since I am still learning) which piece of code may be needed. Please help me to deal with this situation.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question