0
React js
you think functionall component is better or class base? which one is better? i think functionall
3 ответов
+ 6
Mostafa Mohamadi I prefer ReactJS Functional components over class based as a starting point.
If there is ever a need for lifecycle events or maintaining component state, you can always change from a pure function to class based. However, with React Hooks, I can't really think of a reason for class component being needed.
+ 2
With the introduction of hooks functional components can do whatever class based components can do with less boiler plate code. in my opinion they are a little easier to reason about aswell.
+ 1
Functional syntax new and is the trend. Vue just changed to allow functional syntax too.