Does having react16.7 hooks, mean that you don't have to use class components?

does having react16.7 hooks, mean that you can use functional components instead of class components?

Nov.01,2021

redux is still necessary for project engineering.

hooks did three things

  • simplify state
  • simplify lifecycle
  • provide a custom method Hook.

these are only for React's Component , but have no effect on the React project.

before that, when your project engineering was good enough, code like extends React.Component was rare, and relatively more was SFC .
so just from the point of view of whether or not to use class , hooks is still not very useful from an engineering point of view.

but for React Component itself, it means a lot. Especially useEffect .


Yes. But Dan said that because of backward compatibility, he didn't want people to go to the trouble of rewriting the project, and Class wouldn't abandon it.


Yes. You don't have to write class, even react redux. React hooks is so important that I don't know how to describe it.

Menu