Transcript
00:00 All right, so we've got a create element right here. What we're going to do is instead of creating hello world, we're now creating this p tag. So we'll just start with this one. We'll modify it to say p. And yeah, here's Sam's favorite food. There we go. And then we'll have our ULs.
00:18 We don't need the space anymore, so we can get rid of that. We'll have our UL. And this does have a class on it, so we'll say class name, Sam's food. And then here we're going to have a couple of children. These are going to be LI elements. So yeah, we'll have one LI right there and one there.
00:36 So green eggs and ham. Save that. And that gets us our nested UI that we were looking for from the requirements here. So we're doing a couple layers of nesting here, which starts to feel a little uncomfortable the further you get along this, like building a full big UI out
00:55 of these nested create element calls could be a little bit much. So this is why we have JSX. But hopefully this gives you a good idea of how the composition works with React and its create element API. These elements just continue on into infinity, basically.
01:12 So that is the create element API with deep nesting in React.