Q 1 What is difference between class component & function component Syntax: Class components are defined using the class keyword, while function components are defined using a JavaScript function. State: Class components can have state, which allows them to keep track of data that changes over time. Function components, on the other hand, cannot have state until the introduction of React hooks. Lifecycle methods: Class components have lifecycle methods, such as componentDidMount and componentWillUnmount, which allow developers to execute code at specific points in the component's lifecycle. Function components did not have these until the introduction of React hooks. Code organization: Class components tend to have more verbose syntax and can be harder to read and follow. Function components, especially with hooks, can be simpler and more concise, making them easier to read and maintain. Performance: Function components are generally faster and have better performance than cl...