Answer the question
In order to leave comments, you need to log in
Passing component props or state + map, REACT?
Good evening. Clarify please. I understand react. And there is a small question about rendering the same type of components. For example, there is Navigation. We can simply pass props to the Navigation component (and it turns out that the component simply consists of rendering one Navigation item) or, through the state + map inside the Navigation component, draw the required number of Navigation items. What will be more correct? Or are states still needed when we change states inside the component, and in our case, Navigation receives data from a la back?
Answer the question
In order to leave comments, you need to log in
In the case of navigation, pass an array of elements to props and render using the map method .
Don't forget to pass a key property to each element .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question