Challenges

Introduction

Components

Now, have a look at this code block.

šŸ‘‹ I didn't include the ReactDOM.render code here to make things simple.
(I won't include that in the rest of the course too.)
function Welcome() {
    return (
        <div>
            <hr/>
            <p>Welcome to React</p>
        </div>
    )
}

function Page() {
    return (
        <div>
            <h1>Hello World</h1>
            <Welcome />
        </div>
    )
}

Here we have another React component called Welcome. We can render it inside our "Page" component using this syntax: <Welcome /> Basically, you can render it like any other HTML element.

Now try to rename our component into welcome and render it again.
(Use this live React editor to try it out.)

Q: What has happened?
authenticating...

šŸ™ We need your help

We need your help to keep maintain & add new content to this course. Here's how you can support us: