Skip to content

Commit 90f6a22

Browse files
Clarify API docs for OnAfterRender (#49519)
* Clarify API docs for OnAfterRender * Update src/Components/Components/src/ComponentBase.cs Co-authored-by: Steve Sanderson <[email protected]> * Update src/Components/Components/src/ComponentBase.cs --------- Co-authored-by: Steve Sanderson <[email protected]>
1 parent 6e3fe7c commit 90f6a22

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/Components/Components/src/ComponentBase.cs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,12 @@ protected virtual bool ShouldRender()
124124
=> true;
125125

126126
/// <summary>
127-
/// Method invoked after each time the component has been rendered.
127+
/// Method invoked after each time the component has rendered interactively and the UI has finished
128+
/// updating (for example, after elements have been added to the browser DOM). Any <see cref="ElementReference" />
129+
/// fields will be populated by the time this runs.
130+
///
131+
/// This method is not invoked during prerendering or server-side rendering, because those processes
132+
/// are not attached to any live browser DOM and are already complete before the DOM is updated.
128133
/// </summary>
129134
/// <param name="firstRender">
130135
/// Set to <c>true</c> if this is the first time <see cref="OnAfterRender(bool)"/> has been invoked
@@ -141,9 +146,15 @@ protected virtual void OnAfterRender(bool firstRender)
141146
}
142147

143148
/// <summary>
144-
/// Method invoked after each time the component has been rendered. Note that the component does
145-
/// not automatically re-render after the completion of any returned <see cref="Task"/>, because
146-
/// that would cause an infinite render loop.
149+
/// Method invoked after each time the component has been rendered interactively and the UI has finished
150+
/// updating (for example, after elements have been added to the browser DOM). Any <see cref="ElementReference" />
151+
/// fields will be populated by the time this runs.
152+
///
153+
/// This method is not invoked during prerendering or server-side rendering, because those processes
154+
/// are not attached to any live browser DOM and are already complete before the DOM is updated.
155+
///
156+
/// Note that the component does not automatically re-render after the completion of any returned <see cref="Task"/>,
157+
/// because that would cause an infinite render loop.
147158
/// </summary>
148159
/// <param name="firstRender">
149160
/// Set to <c>true</c> if this is the first time <see cref="OnAfterRender(bool)"/> has been invoked

0 commit comments

Comments
 (0)