next-react-server-components
next-react-server-components copied to clipboard
What is the Nav component doing?
Hi everyone,
Thanks for sharing this demo!
I was looking at the source of Nav
component:
export default function Nav() {
;<ul className="nav-ul">
<Item href="/newest">new</Item>
...
<style jsx>{`
...
`}</style>
</ul>
}
Why is this component returning undefined
? What does it do if nothing is being returned?
How does this have an effect on DOM, state, styles, or anything else?
Is this a common pattern? Where can I read more about this? I'm intrigued :)
It was a clone of hacker news nav bar
We hide it in the demo it's because that's not the major point of this demo. We don't want user to be distraced from the main content displaying. It's just not used. We'll clean it up later, thanks for noticing it
Thank you for answering. I was afraid it a was a new horrible way of doing invisible things. Turns out it does was it says :)
We brought back the nav when refactoring 😄
https://next-rsc-hn.vercel.app/