React js | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

React js

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

5th Oct 2019, 7:11 PM
Mostafa
Mostafa - avatar
3 Answers
+ 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.
6th Oct 2019, 2:10 AM
David Carroll
David Carroll - avatar
+ 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.
6th Oct 2019, 3:29 PM
Haon1919
Haon1919 - avatar
+ 1
Functional syntax new and is the trend. Vue just changed to allow functional syntax too.
5th Oct 2019, 10:22 PM
Gordon
Gordon - avatar