Skip to content

In /app directory, is there any way to pass data to the layout even statically? #44506

Closed Answered by leerob
zackdotcomputer asked this question in Help
Discussion options

You must be logged in to vote

You shouldn't need to pass data – instead, you would call the same function multiple times and use React's cache() function.

You'll notice this pattern in a few places throughout Next.js. For example, calling the same API in the default exported component for a page as well as generateMetadata or generateStaticParams.

Replies: 4 comments 8 replies

Comment options

You must be logged in to vote
4 replies
@maltekuehl
Comment options

@maltekuehl
Comment options

@zackdotcomputer
Comment options

@maltekuehl
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@welschmoor
Comment options

Comment options

You must be logged in to vote
3 replies
@maltekuehl
Comment options

@leerob
Comment options

@maltekuehl
Comment options

Answer selected by leerob
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
6 participants