Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nesting not called in "Nesting components" code snippet #851

Open
thetillhoff opened this issue Aug 31, 2024 · 1 comment
Open

Nesting not called in "Nesting components" code snippet #851

thetillhoff opened this issue Aug 31, 2024 · 1 comment

Comments

@thetillhoff
Copy link

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
Copy link
Author

... Just read on with the next chapter, which then tackles that part.
But, I think it would make sense to add a Sentence at the end along the lines "How to use that new component is described next."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant