What does it mean for a component to inherit from another component?

Question

In the context of this lesson, what does it mean for a component to inherit from another component?

Answer

In this context, “inherit” means that a stateless component receives the state from a parent component which does have a state, in the form of props. The information that the stateless component displays is entirely dependent on the information passed down to it, as it does not have any state of its own.

This term is not to be confused with “inheritance” as used in classes extending other classes.

1 Like