Challenge: Create Functional Components
メニューを表示するにはスワイプしてください
Create a functional React component that displays a greeting message using props.
The task consists of two parts:
- Create a child component
- Create a component called
Greeting. - Accept a prop called
name. - Render an
h2element with the text:Hello, {name}.
- Create a component called
- Create a parent component
- Create a component called
App. - Render the
Greetingcomponent inside it. - Pass the value
"Oliver"to thenameprop.
- Create a component called
- Render the
Appcomponent- Render the
Appcomponent usingroot.render.
- Render the
- The child component receives data using props.
- Use
{props.name}inside JSX. - Pass the
nameprop when renderingGreeting. - The
Appcomponent should be rendered to the DOM.
すべて明確でしたか?
フィードバックありがとうございます!
セクション 1. 章 7
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください
セクション 1. 章 7