Before react hooks, we called functional components to stateless components. At that time it was really faster than class components but what about now?
Since we have react hooks, stateless components are no longer precise. Does the functional components are faster than class components which runs same functions?
e.g. In functional components,
- I can handle
statevariables by usinguseStatehook. useEffectcan representcomponentDidMount,componentWillReceivePropsor some other lifecycle methods in Class component.- ... ... ...
We have many other hook functions but which hooks will make my class components faster or lightweight?