2
I’m new to React and I always get a flea behind my ear when I’m creating some components. After all, the right way to structure is like this
<label>alo {nome}</label>
or creating a const or Function that returns me a label with the values, I’m talking about when we have many repetitive components... a friend told me that the code became smaller and more readable using functions, But on the other hand, it decayed in performance because it called several times the same function. But I have a hard time believing anything that speaks to me without having a concrete basis... So I ask you, what is the right way? if someone can give the answer together an explanation, I am very grateful.
Let me see if I understood, this same label format would be used several times in the same component?
– G. Bittencourt
Here is an explanation of the difference between making the component as a class or as a function https://medium.com/rocketseat/um-guia-para-beginners-no-react-js-80e1ac357649
– Bins
That, too, G. Bittencout... sorry it took me so long to answer is why these days I was camping and there was no internet. Thank you so much for the article Bins, I took a look and this is exactly what I’m learning about life cycle components and such, but it’s not quite about that my doubt(At least I think not).
– Mateus Silva
Your question was very confusing, but I believe the reading of the section Thinking the React Way available in official documentation can help you assimilate various basic concepts.
– Giovane de Loredo