Problem Statement
Differentiate between class components and functional components in React Native.
Explanation
Class components use ES6 classes and can access lifecycle methods like componentDidMount. Functional components are plain functions that return JSX and rely on hooks (like useState and useEffect) to manage state and side-effects.
Functional components are now the standard approach—they are shorter, easier to test, and better optimized by React.