React js | SoloLearn: Learn to code for FREE!


React js

you think functionall component is better or class base? which one is better? i think functionall

10/5/2019 7:11:44 PM


4 Answers

New Answer


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.


functional with hooks


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.


Functional syntax new and is the trend. Vue just changed to allow functional syntax too.