React: Class components
functional components - good for simple content
class components - good for just about everything else
As an example, imagine we are waiting for some callback, which can take 3 seconds and only after it finish we want to display jsx / html. We are not able to do this with functional component.
Class components
- easier code organization
- can use
state
(easier to handle user input) - understands lifecycle events (easier to do things when the app first starts)
- must be a javascript class
- must extend React.Component
- must define a
render
method that return some amount of JSX