I_jay
February 18, 2021, 1:25pm
1
please could you assist …
thanks
**Your code so far**
const ChildComponent = () => {
return (
<div>
<p>I am the child</p>
</div>
);
};
class ParentComponent extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<div>
<h1>I am the parent</h1>
{ /* Change code below this line */ }
return (
<div>
<h1>I am the parent</h1>
<ChildComponent />
</div>
);
{ /* Change code above this line */ }
</div>
);
}
};
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36.
Challenge: Create a Component with Composition
Link to the challenge:
miku86
February 18, 2021, 1:41pm
2
Hey there,
why did you remove the Tell us what’s happening section?
Please explain why you need help.
I_jay
February 18, 2021, 2:34pm
3
"This is my code :- i just cant pass the challenge think i wrote the code right…
const ChildComponent = () => {
return (
<div>
<p>I am the child</p>
</div>
);
};
class ParentComponent extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<div>
<h1>I am the parent</h1>
{ /* Change code below this line */ }
return (
<div>
<h1>I am the parent</h1>
<ChildComponent />
</div>
);
{ /* Change code above this line */ }
</div>
);
}
};
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).
miku86
February 19, 2021, 7:37am
5
Hey there,
on the left side of the lesson, you can see how to return a component in another component, e.g. <Dashboard /> to return the Dashboard component.
Your task is to return the ChildComponent below the h1.
Just the ChildComponent, nothing else.
I_jay
February 20, 2021, 8:07am
6
Alright Thank You :slightly_smiling_face: