0
In 2021 should I start learning react using class component or no need now and start directly with function component?
5 Answers
+ 3
Start learning function components. As react hooks are pretty easy to implement and use less lines of code when compared to their class counterparts to achieve the same results.
But you should also know class components because most of the applications when written were written mostly using class components and not everyone is rewriting them using function components.
I am a beginner myself so you could wait on someone who has more experience to share their thoughts.
+ 2
For new project, always use functional components.
0
I would suggest learning both. Obviously, function components in React are more efficient and simple, but class components can still be used, depending on the situation.
0
Thank you all.
0
One last thing what is the difference is it only the keyword this in the state or the whole thinking and coding is different from using functions?