how to make a parent component return the child

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**
class ParentComponent extends React.Component {
constructor(props) {
  super(props);
}
render() {
return (
<div>
<h1>I am the parent</h1>
<class ChildComponent I am the second child />
</div>
);
 };  
};


  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Firefox/102.0

Challenge: Create a Component with Composition

Link to the challenge:

Do you have a component on the editor named like this ?

The challenge has a syntax example:

return (
 <App>
  <Navbar />
  <Dashboard />
  <Footer />
 </App>
)

The ChildComponent component does not take any content or props, the text it renders is already inside the component. So the syntax is just:

<SomeComponentName />

yes, correct.
Also, The component should return the ChildComponent as its second child.

Yes, I tried so but the error reads, The component should return the ChildComponent as its second child.

What have you changed from the code you posted in the first post?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.