when to use a class based react component code example Example: create-react-app class component npx create-react-app my-app --scripts-version [email protected]