Consider a simple component that displays a greeting. How does Astro's rendering approach differ from Next.js in this case?
Think about how much JavaScript each framework sends to the browser by default.
Astro focuses on shipping as little JavaScript as possible by rendering components to static HTML by default. Next.js supports server-side rendering and client-side rendering, often sending more JavaScript to the browser.
Identify the correct way to define a page route in Next.js using the App Router.
Next.js App Router uses a special folder structure for routing.
In Next.js App Router, page components are default exports placed in the app directory with filenames like page.tsx to define routes.
Given that React hooks are used inside gatsby-node.js, what is the cause of the build failure?
Consider where gatsby-node.js runs and what React hooks require.
gatsby-node.js runs in the Node.js environment during build time, which does not support React hooks that require a React rendering context.
Consider this Astro component snippet:
<script client:load>
let count = 0;
function increment() {
count += 1;
document.getElementById('count').textContent = count;
}
</script>
<button onclick="increment()">Clicked <span id="count">0</span> times</button>What will the user see initially and after clicking the button?
Think about what client:load does in Astro.
The client:load directive hydrates the component on page load, enabling interactivity like updating state on button clicks.
You want to build a blog with many static pages and minimal client-side JavaScript. Which framework is the best choice?
Consider which framework optimizes for static content with less JavaScript.
Astro is designed to generate static HTML with minimal JavaScript, making it ideal for content-heavy sites with little interactivity.
