Skip to content

Run code after prerendered embedded Server component has been materialized in the browser #49389

Answered by javiercn
marinasundstrom asked this question in Q&A
Discussion options

You must be logged in to vote

When the components execute on the server they are gone by the time the HTML is transferred to the client. Executing a script in that case can be achieved by subscribing to "enhancedload" in the Blazor ecosystem or using a mutation observer to get notified when a given element appears on the page.

If we are talking interactive components, they will trigger an OnAfterRender the moment they become interactive and render in that mode for the first time.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by javiercn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area-blazor Includes: Blazor, Razor Components
2 participants