employer cover photo
employer logo
employer logo

Viitorcloud Technologies

Est-ce votre entreprise ?

Question d’entretien chez Viitorcloud Technologies

What is the difference between functional components and class components in React?

Réponse à la question d'entretien

Utilisateur anonyme

12 août 2025

I explained that functional components are JavaScript functions that accept props and return JSX, and they became more powerful after React introduced hooks for state and lifecycle management. Class components, on the other hand, are ES6 classes that extend React.Component and use this.state and lifecycle methods like componentDidMount. I also mentioned that functional components are generally simpler, easier to test, and preferred in modern React development.