I'm wondering how I can prevent prop drilling with SSR in the following situation:
Layout.tsx:
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
const user = await getUser(cookies().get("accessToken")?.value);
return (
<html lang="en">
<body>
<Navigation user={user}
{children}
</body>
</html>
);
}
Now imagine in Navigation
there are multiple nested components that require the user
. Normally I'd use the store to pass down data like this but now I'm a bit clueless.