next-learn
next-learn copied to clipboard
Nesting not called in "Nesting components" code snippet
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.
... 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."