
support-prerendering
Make interactive Blazor components work correctly with prerendering
by dotnetFree
Description
Support Prerendering is an agent skill for making interactive Blazor components behave correctly when prerendering is on. Prerendering is on by default for the interactive render modes. The server sends static HTML first, so the page appears at once, and then the Server or WebAssembly runtime loads and re-renders the component with full interactivity. The skill is for fixing the problems that come from that handoff: duplicate data loads, UI flicker while the prerendered page becomes interactive, and similar issues. It explains the behaviour the agent has to plan for. OnInitializedAsync runs twice, once during prerender and again when the interactive runtime attaches. OnAfterRenderAsync is not called during prerender, only after the interactive render. Internal navigation between interactive pages skips prerendering, which happens only on full page loads. The first step tells the agent to read the project's AGENTS.md file and check its Interactivity Mode and Interactivity Scope before it changes anything. It is for Blazor developers who see double requests, flashes of changed content or state that resets on load, and want a fix that fits how their project is set up.…
Highlights
- Fixes duplicate data loads in Blazor components
- Removes flicker during the prerender handoff
- Explains OnInitializedAsync and OnAfterRenderAsync timing
- Checks the project's AGENTS.md interactivity settings first
Ratings & Reviews
No ratings yet
Be the first to rate support-prerendering.
People also visit

author-component
Create or review Blazor components (.razor files) with correct architecture

plan-ui-change
Plan complex Blazor UI features by decomposing them into focused components

fetch-and-send-data
Call APIs, load data into components, and handle the async lifecycle in Blazor

create-blazor-project
Create a new ASP.NET Core web application or web site using Blazor
support-prerendering FAQ
What problem does this skill solve?
Blazor components that load data twice, flicker when they become interactive, or behave differently after prerendering.
Why does OnInitializedAsync run twice?
The skill says prerendering renders the component once as static HTML, and the interactive runtime then renders it again.
How do I install it?
Run npx skills add https://github.com/dotnet/skills --skill support-prerendering in your project.
Is it free and open source?
Yes. It is published in the public dotnet/skills repository on GitHub.
What do the security audits say?
skills.sh lists Gen Agent Trust Hub: Pass, Socket: Pass and Snyk: Pass for this skill.
What are the best support-prerendering alternatives?
Popular alternatives to support-prerendering include author-component, use-js-interop and plan-ui-change. See all support-prerendering alternatives













