#I ve been looking for an example to
1 messages ยท Page 1 of 1 (latest)
ah, so you're mainly asking how to replace the redirect return from getServerSideProps?
mhm, among other things, that's definitely one thing I've been looking for
and (to summarize what I said above) can the root layout receive data from the page's data, like _app.tsx does? This helps me set up the applications's contexts and hydrate the client state
https://beta.nextjs.org/docs/data-fetching/fundamentals#component-level-data-fetching
I think the warning here answers that question?
Warning: It's not possible to pass data between a parent layout and its children. However, you can fetch the same data in a route more than once and React will automatically dedupe the requests without affecting performance.
Unfortunately I don't have an answer for the redirect question right now, I'm on the turbopack team, not the next team ๐
No worries, thank you ๐
I think you can redirect the same way you use notFound
https://beta.nextjs.org/docs/api-reference/notfound#notfound
change the import to
import { redirect } from 'next/dist/client/components/redirect';