September 2018
Intermediate to advanced
764 pages
20h 6m
English
Regardless of the syntax, all React components must be pure. A pure component is one where:
Pure functions and functional components are good because they are easier to understand and test. Therefore, when we have a large or heavily-nested component like our Form element, it's good practice to break it down into smaller pure functional components, and use these components to compose the element.
Try turning our button into its own (simple) component. The end result should look like this:
function Input(props) { return <label>{props.label}<input ...Read now
Unlock full access