Introducing the function component
In this section, we are going to introduce you to the function component. When the function component was first introduced in React 0.14 in August 2015, it was named as a stateless pure function:
function StatelessComponent(props) { return <div>{props.name}</div> }
The main intention was that "stateless pure-function components give us more opportunity to make performance optimizations."
A function component with no state, by default, is designed to take the following function form:
We are going to explore parts of a function component in detail in the next subsections.
Function props
The input argument of this function is referred to as a prop. Props take an...