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.

Exercise: Build a React component

Exercise: Build a React component

There's nothing like a delicious cup of coffee and writing a React component. It's like one of the magical mysteries of life. Hard to describe why. Put them together and you just live in the dream. Good to be back with you. Hope you're comfortable and ready to keep and eager to continue. And hopefully this is making sense. Where we left off here, we've got this homepage component now that has a sub-component as a title, which we're passing properties over. We set the properties up in the title, and in our title, then we just pass those properties. Now, you could use other names, but props is basically a standard and widely accepted convention of passing the data over from our parent component to our child component. The parent component is the homepage, right? This is the father, and title is a child because it's within it and title has some property data the title being set to this text and then that's getting passed over with props props and notice we grab the title from props this…

Contents