What are the differences between a class component and functional component?

Technology CommunityCategory: ReactWhat are the differences between a class component and functional component?
VietMX Staff asked 3 years ago
  • Class components allows you to use additional features such as local state and lifecycle hooks. Also, to enable your component to have direct access to your store and thus holds state.
  • When your component just receives props and renders them to the page, this is a stateless component, for which a pure function can be used. These are also called dumb components or presentational components.