From the course: Building UI Components with Storybook: Master React Components and UI Design with Storybook for Better Efficiency
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
The React component tree and composite components
From the course: Building UI Components with Storybook: Master React Components and UI Design with Storybook for Better Efficiency
The React component tree and composite components
Did you have fun playing around with this function component? Hopefully you had some fun. Maybe you changed the text around and you turned it into my cool amazing app or something like that. You could save that. And if we go and check back to the browser, maybe you played with the CSS a little bit. We see the color's red. Maybe you switched it back to white. Boom. Maybe you increase the font size. By the way this is just running 12 pixels plus 2 for the view for the view of a minimum so that adds a bit of a relative size to it but you could also just put 14 pixels if you're just messing about. Notice how without the viewport calculation it's not going to take into account what the view minimum is and even though you're putting in a higher pixel you get a smaller result. I could put 140 pixels and it'll be really big. Okay. All right. So that's great. So this is a functional component in React. It's a function. It's returning some JSX. We saw how we could add JavaScript here by adding…
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)
Important note on the upcoming sections3m 20s
-
(Locked)
What is the DOM and what is the React Virtual DOM? React fundamentals8m 31s
-
(Locked)
How to start building a React app with CRA4m 2s
-
(Locked)
CRA: React files and dependencies, an overview8m 51s
-
(Locked)
How to connect the root of React to the DOM and rendering React application6m 59s
-
(Locked)
Running a local development server of React9m 10s
-
(Locked)
What are functional components in React11m 2s
-
(Locked)
Quick observation on ECMAScript standards with React3m 36s
-
(Locked)
The React component tree and composite components8m 34s
-
(Locked)
How props work in React7m 6s
-
(Locked)
Exercise: Build a React component7m 50s
-
(Locked)
What are hooks in React12m 24s
-
(Locked)
Input dynamic tests and events with React9m 20s
-
(Locked)
Event handling practice and section summary12m 41s
-
(Locked)
-
-
-
-
-