Answers for "what difference between react func and class components"

0

what difference between react func and class components

And so to answer our question before, you should use functional components if you are writing a presentational component which doesn’t have its own state or needs to access a lifecycle hook. Otherwise you can stick to class components or take a look into the library recompose which allows you to write functional components and enhance them with a state or lifecycle hooks with HOCs!
Source: https://djoech.medium.com/functional-vs-class-components-in-react-231e3fbd7108
Posted by: Guest on October-05-2021

Code answers related to "what difference between react func and class components"

Code answers related to "Javascript"

Browse Popular Code Answers by Language