Where do you dedupe/cache calls shared between layout.tsx and page.tsx? #69014
Unanswered
codinginflow
asked this question in
App Router
Replies: 1 comment
-
@codinginflow, I am wondering how do you even access page params in layout.tsx? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When you fetch the same data in a
page.tsx
and it'sgenerateMetadata
, it's good to deduplicate it using React'scache
function so you don't fetch the data twice:My question:
Say you need this value also in the shared layout.tsx of that folder, where do you put
getCollectionCached
?This is only a question about folder structure.
Beta Was this translation helpful? Give feedback.
All reactions