In the last chapter, we explored React properties (props). Just as components can have properties, they can also have states. States are primarily set to those components where it is necessary to change, for example if the component has to be updated or replaced in future. Thus, it is not mandatory to have a state for the entire component.
Components can be both stateless and stateful:
Stateless components are those where only props are present, but no state is defined. Thus, there will no change in these prop values for these components within the component life cycle. The only source of static data should be presented to the component instance via the props. Thus, props are immutable data for a React component.
Stateful components: Stateless components, are meant to represent any React component declared as a function that has no state and returns the same markup given the same props. As the name implies, stateful components are those where both props and states...