React - Create a Component with Composition

Tell us what’s happening:
I didn’t understand this The component should return the ChildComponent as its second child.
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 */ }
           <childComponent/>
        

        { /* 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/110.0.0.0 Safari/537.36

Challenge: React - Create a Component with Composition

Link to the challenge:

childComponent isn’t the same as ChildComponent

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