Pergunta de entrevista da empresa State Street

What is the difference between a class and functional component.

Resposta da entrevista

Sigiloso

30 de mar. de 2025

A class component has “this” which allows a component to set up global variables, state, and call props. A functional component doesn’t have this and must inherit it from its parent component. However, class components have fallen out of favor, as hooks have given functional components the ability to maintain state.