Domanda di colloquio di State Street

What is the difference between a class and functional component.

Risposta di colloquio

Anonimo

30 mar 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.