Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Create Functional Components | Section
React Basics for Next

bookChallenge: Create Functional Components

メニューを表示するにはスワイプしてください

Create a functional React component that displays a greeting message using props.

The task consists of two parts:

  1. Create a child component
    • Create a component called Greeting.
    • Accept a prop called name.
    • Render an h2 element with the text: Hello, {name}.
  2. Create a parent component
    • Create a component called App.
    • Render the Greeting component inside it.
    • Pass the value "Oliver" to the name prop.
  3. Render the App component
    • Render the App component using root.render.
  • The child component receives data using props.
  • Use {props.name} inside JSX.
  • Pass the name prop when rendering Greeting.
  • The App component should be rendered to the DOM.
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 1.  7

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

セクション 1.  7
some-alt