첫 번째 컴포넌트

원문 https://ko-react-exy5xcwjj-fbopensource.vercel.app/learn/your-first-component#components-ui-building-blocks

컴포넌트: UI 구성 요소

<article>
  <h1>My First Component</h1>
  <ol>
    <li>Components: UI Building Blocks</li>
    <li>Defining a Component</li>
    <li>Using a Component</li>
  </ol>
</article>

1️⃣ HTML 마크업과 컴포넌트 사용

2️⃣ 컴포넌트 작성 및 중첩

3️⃣ React의 장점

컴포넌트를 활용해 재사용 가능한 UI 요소를 만들고, HTML 태그와 컴포넌트를 결합해 페이지를 구성하는 것이 핵심!

<PageLayout>
  <NavigationHeader>
    <SearchBar />
    <Link to="/docs">Docs</Link>
  </NavigationHeader>
  <Sidebar />
  <PageContent>
    <TableOfContents />
    <DocumentationText />
  </PageContent>
</PageLayout>

컴포넌트 정의하기

export default function Profile() {
  return (
    <img
      src="<https://i.imgur.com/MK3eW3Am.jpg>"
      alt="Katherine Johnson"
    />
  )
}

1단계: 컴포넌트 내보내기