next-react-server-components icon indicating copy to clipboard operation
next-react-server-components copied to clipboard

What is the Nav component doing?

Open gabssnake opened this issue 1 year ago • 2 comments

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 :)

gabssnake avatar Jul 29 '22 07:07 gabssnake

It was a clone of hacker news nav bar image

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

huozhi avatar Jul 29 '22 10:07 huozhi

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 :)

gabssnake avatar Jul 30 '22 04:07 gabssnake

We brought back the nav when refactoring 😄

https://next-rsc-hn.vercel.app/

leerob avatar Nov 13 '22 17:11 leerob