课程: Learning Full-Stack JavaScript Development: MongoDB, Node, and React

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Handling data in an array

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…

内容