Difference between class and functional components.

Class components are ES6 classes extending React.Component, using lifecycle methods and this.state. Functional components are simpler and rely on React hooks like useState and useEffect to manage state and lifecycle.