Answer the question
In order to leave comments, you need to log in
Which components to use, Class or Functional in React?
I recently started learning React and am wondering what components to use?
It seems like it doesn't matter, for Functional components there are Hooks that give the capabilities of classes and write code normally, but then why not write on classes. Yes, and on the Internet there are somehow more guides on functional ones, like Google how to make such and such a feature, and there the approach is shown only for functional ones
. And now I just want to ask knowledgeable people which of these approaches to go deep into and whether there is any big difference?
Answer the question
In order to leave comments, you need to log in
https://medium.com/@dan_abramov/making-sense-of-re...
Note from Dan Abramov.
There are very rare cases that cannot yet be implemented with functional components and hooks, they are described in the documentation, in other cases I advise you to prefer functional components and hooks. You need to "deep" into both approaches, the whole deepening is that you should know the life cycle of components well, and deprecated too, at least to be able to refactor the old code, but if you are writing a new component, write it in a functional style.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question