next-learn icon indicating copy to clipboard operation
next-learn copied to clipboard

Nesting not called in "Nesting components" code snippet

Open thetillhoff opened this issue 5 months ago • 1 comments

On section for Nesting components, there's the following code snippet:

function Header() {
  return <h1>Develop. Preview. Ship.</h1>;
}
 
function HomePage() {
  return (
    <div>
      {/* Nesting the Header component */}
      <Header />
    </div>
  );
}
 
const root = ReactDOM.createRoot(app);
root.render(<Header />);

As it is, the components are nested, but the wrong one is then rendered. It should be root.render(<HomePage />); instead.

thetillhoff avatar Aug 31 '24 09:08 thetillhoff