0

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

Steve🧢

4 Answers

New Answer

+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.

+3

functional with hooks

+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.