Skip to content
Advertisement

When I first click the delete button, all the notes are disappeared but, when I refresh the page it works just fine

I tried almost everything. I tested my API to ensure that the problem is not with it. It happens just one time when you visit the page. However, when you refresh it works fine.

Before Clicking delete: Click here to see the image

After clicking delete button: Click here to see the image

Backend Route (home.route.js):

JavaScript

React Code:

Code for the Note Component:

JavaScript

Code for the Main App component:

JavaScript

Input Component:

JavaScript

I would also appreciate if you can provide a review of my code because I am a beginner and that would definitely help me.

Advertisement

Answer

Try this approach, (just an assumption)

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement