Complete the code to export a static Astro component.
export const prerender = [1];
---
<h1>Hello, Astro!</h1>Setting prerender = true tells Astro to generate the page statically at build time.
Complete the code to fetch data on the server during rendering.
--- const data = await fetch('[1]').then(res => res.json()); --- <p>{data.message}</p>
Using '/api/message' fetches data from a server endpoint during rendering.
Fix the error in the Astro component to enable hybrid rendering.
export const prerender = [1];
---
<p>Current time: {new Date().toISOString()}</p>Setting prerender = false disables static generation, allowing server rendering for dynamic content.
Fill both blanks to create a hybrid Astro component that statically renders but fetches server data.
export const prerender = [1]; --- const serverData = await [2]('/api/data'); <p>{serverData.info}</p>
Setting prerender = true enables static generation, and using fetch fetches data on the server during rendering.
Fill all three blanks to build an Astro component that statically prerenders and uses server data with a fallback.
export const prerender = [1]; export const hydrate = '[2]'; --- const data = await [3]('/api/info'); <p>{data.detail}</p>
Static prerendering is enabled with true. Hydration on the client is set with 'client'. Server data is fetched using fetch.
