From the course: Learning Full-Stack JavaScript Development: MongoDB, Node, and React
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Handling data in an array
From the course: Learning Full-Stack JavaScript Development: MongoDB, Node, and React
Handling data in an array
- [Instructor] In this final chapter, we're going to see an example of how to persist user's data into the project's database. We're going to give the user the ability to propose a name on any naming contest. First, let's display the list of already proposed names here in the contest view. We have some proposed names in the test data. Let's make them show up here. That work needs to go in the contest component. Let me console log contest to see the structure. Refresh. This is the contest information and we have an array of names on it. Every name has an ID and a name and a timestamp. So I'll do this in here under the description and I'm going to do it in the same component here. As an exercise, think about how to extract this into different components at the end of this video. The array that we're interested in is contest.names and this is what we need to map into HTML. But let's first add a title for this section…
Contents
-
-
-
-
-
-
-
(Locked)
Handling data in an array3m 27s
-
(Locked)
Reading form data with the DOM API6m 49s
-
(Locked)
Understanding HTTP request methods2m 19s
-
(Locked)
Using an API endpoint to update data9m 48s
-
(Locked)
Updating UI based on API response1m
-
(Locked)
Project challenge2m 1s
-
(Locked)
Next steps1m 27s
-
(Locked)