If the behaviour of a component is independent of its state then it can be a stateless component. You can use either a function or a class for creating stateless components. But unless you need to use a lifecycle hook in your components, you should go for function components. There are a lot of benefits if you decide to use function components here; they are easy to write, understand, and test, a little faster, and you can avoid the this keyword altogether.
React esencial#34 · Preguntas adaptadas de sudheerj/reactjs-interview-questions (MIT)
What are stateless components?
Traducción al español en progresoEl contenido detallado de esta lección aún se está traduciendo. Mientras tanto, se muestra en inglés.
¿Qué tan bien recordaste esto?