From the course: Web Components and Modularization: Practical Approaches
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Input and output
From the course: Web Components and Modularization: Practical Approaches
Input and output
- [Instructor] Mapping out what data is needed and how the data flows through the components is vital for the components to work properly and for efficient development. Before I start passing actual data from component to component, I like to map it out and leave comments in each component's file explaining what data the component receives and what data it sends. I do this by traversing the tree from the outermost leaf inwards. Let me show you how that works. In the BookCarousel Components, the outermost leaves are BookTitle, BookAuthor, and BookPrice and we'll start there by looking at BookTitle. Here in the comments, I've added two new lines that say Receives: props.book.title and Sends: nothing. This is a leaf, it's at the end of the tree and it doesn't have any more child components that's why it doesn't send anything. And what it receives is the information necessary to display the content properly, which in this…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Plan before you code1m 25s
-
(Locked)
Raw output2m 32s
-
(Locked)
Properties1m 49s
-
(Locked)
Input and output3m 27s
-
(Locked)
State2m 7s
-
(Locked)
Who owns state?2m 11s
-
(Locked)
Life cycle1m 18s
-
(Locked)
Challenge: Scope a complex component1m 20s
-
(Locked)
Solution: Scope a complex component5m 5s
-
(Locked)
-
-