employer cover photo
employer logo
employer logo

Viitorcloud Technologies

Is this your company?

Viitorcloud Technologies interview question

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

Interview Answer

Anonymous

12 Aug 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.