Closed aheissenberger closed 2 months ago
Thanks @aheissenberger for the changes on the example, this looks a lot nicer now!
What I did on your branch:
getConfig
exports, these are not used by the frameworkusePathname
to get the current pathname to enable displaying the active linkThe 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.
open tasks - need help: