In the child component, we want to map through the list of items we have and output each item as a separate entity. If you need to add a className there, its clear that either you add a dom element in this case another div or add the className to its parent. For example, letâs say we want to pass a list of items as props from a parent component to a child component. What Fragments tries to solve its the unnecessary dom elements but this doesnt mean that Fragments will replace div entirely. When mapping a list of items, you still need to make use of keys the same way as before.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |