Pro-React-16_10_Components-props
Based on Chapter 10 of Pro-React-16
Create Example Project
1.- Creates a generic React app
Understanding Components
2.- Creates a simple component that returns text to be rendered
- Introduces JSX to mix HTML and JavaScript and alternate syntax, including fat arrow
- Adds child components
Understanding Props
3.- Defines props in parent component
- Receives props in child component
Combining JS and Props to render content
4.- Selectively renders content in child component
- Renders arrays
- Renders multiple elements
- Renders no content
Using function props
5.- Passes functions through props
Passing props to child components
6.- Uses props to abstract specific components to generic ones
- Passes on all props to child component via destructuring operator
Using Default prop values
7.- Defines set of default prop values
Type checking prop values
8.- Adds propTypes to child component
- Allows multiple types for a prop