From d601a56c1cf48bfa3d03248cbace08cce7802133 Mon Sep 17 00:00:00 2001 From: Luke Latham Date: Mon, 21 Sep 2020 10:57:31 -0500 Subject: [PATCH] Enhance Blazor OnAfterRender[Async] content (#19951) --- aspnetcore/blazor/components/lifecycle.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aspnetcore/blazor/components/lifecycle.md b/aspnetcore/blazor/components/lifecycle.md index d8f97f38cc..4f9ffe9614 100644 --- a/aspnetcore/blazor/components/lifecycle.md +++ b/aspnetcore/blazor/components/lifecycle.md @@ -135,7 +135,10 @@ protected override void OnAfterRender(bool firstRender) } ``` - and *aren't called when prerendering on the server.* + and *aren't called during the prerendering process on the server*. The methods are called when the component is rendered interactively after prerendering is finished. When the app prerenders: + +1. The component executes on the server to produce some static HTML markup in the HTTP response. During this phase, and aren't called. +1. When `blazor.server.js` or `blazor.webassembly.js` start up in the browser, the component is restarted in an interactive rendering mode. After a component is restarted, and **are** called because the app isn't inside the prerendering phase any longer. If any event handlers are set up, unhook them on disposal. For more information, see the [Component disposal with `IDisposable`](#component-disposal-with-idisposable) section.