From the course: AWS and React: Creating Full-Stack Apps

Unlock the full course today

Join today to access over 24,600 courses taught by industry experts.

Solution: Deleting DynamoDB data in your React app

Solution: Deleting DynamoDB data in your React app - Amazon Web Services (AWS) Tutorial

From the course: AWS and React: Creating Full-Stack Apps

Solution: Deleting DynamoDB data in your React app

(upbeat electronic music plays) - [Instructor] Well, how did you do on that challenge? I'm sure you did great. If you just followed the pattern of the previous mutations, I'm sure it was very smooth. So, what you needed to do was import the deleteTodo mutation into your app.js file, and then write a new function to use it just like the other mutations, for the most part. Then, of course, call that function with a button tap. So let's look at how to do that. In the mutations file, the same place where I already have the createTodo and updateTodo, I have the deleteTodo. And it takes an input just like the other ones do. So I can pretty much copy the same pattern in my code. In the app.js file, I need to now import that mutation and I'm going to do it right after the updateTodo. I import deleteTodo, and that's all I need to do for step one. The next thing I need to do is write a function to use it. So, I have the…

Contents