lazarv / react-server

The easiest way to build React apps with server-side rendering
https://react-server.dev
MIT License
118 stars 6 forks source link

fix: update Mantine example / cleanup layout #33

Closed aheissenberger closed 1 month ago

aheissenberger commented 1 month ago

open tasks - need help:

lazarv commented 1 month ago

Thanks @aheissenberger for the changes on the example, this looks a lot nicer now!

What I did on your branch:

The only change that might need some clarification is the pathname usage. When rendering the menu on the server-side there was no active link as usePathname imported from @lazarv/react-server/navigation module is a client only hook. But when hydrating the app, it provides the proper pathname on the client causing a hydration error. So I used the server-side equivalent of usePathname from the core module and passed it down to the MainNavigation component. There could be some enhancement on the frameworks part to transfer some server-side data to client-side hooks when rendering client components on the server-side.