Skip to content

How to include API response in component within pre-rendered pages? #2774

Answered by benaltair
benaltair asked this question in Q&A
Discussion options

You must be logged in to vote

As suggested by PM on Discord the API call should happen within load() for the __layout file to be included in the pre-rendered files. I've now removed the store altogether, and passed down a prop from __layout to the Header component with the appropriate data.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by benaltair
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant