Code 401: Class 28 - Component Composition
Questions
-
Can a parent component access the state of a child component? Yes, by using a call back function.
-
What can be passed along in a prop variable? Any and all kinds of data
-
How can a child component “know” the state of another component? This can be done using React Hooks
Vocabulary
- Component Props Properties of components, data that is passed into a component
- Component State this.state, provides the current snapshot of a component
- Application State current snapshot of the entire application
- Life cycle of a component: Mounting, Updating, Unmounting
- Higher-order component function that takes a component and returns a new component
- Hooks aim to replace classes
this.props.children
“is used to display whatever you include between the opening and closing tags when invoking a component”
- Some components do not know their children ahead of time
- A more specific component can render a generic component and configure it with props
- Facebook has not found a use case for component inheritance hierarchies
Return to reading-notes Deployed Site
Return to reading-notes Mark Down