Day 3 of 14 30 minPropschildrenComposition
Pass data into components with props. Destructure props, set defaults, pass functions and JSX as props, use children to build wrapper components, and learn why props are read-only.
By the end of today you can
- Pass data into a component with props and read it by destructuring
- Give props default values
- Pass children and other JSX into components
- Explain why props are read-only and data flows one way
- Split a UI into small, reusable components
What's inside
- 6 sections
- 3 diagrams and mind maps
- 5 code examples you can run
- 5-question quiz
- 1Passing and reading props
- 2Default values and rendering from data
- 3children: components that wrap content
- 4Passing functions: events flow up
- 5Props are read-only
- 6Thinking in components
Sign in free to read this lesson
Get the full lesson with diagrams, runnable code and the quiz. Your progress is saved across devices.
Sign in free