Lesson 1: Components and JSX
A React component is a JavaScript function that returns UI. JSX lets you describe that UI with markup-like syntax.
function Welcome({ name }) {
return <h2>Welcome, {name}!</h2>;
}
function App() {
return <main><Welcome name="Ada" /></main>;
}Component names start with a capital letter. Pass information into a component with props, then return one parent element or a fragment.
Practice
Create a BookCard component that accepts a title prop and renders a heading and short description.