Skip to content

Reference to component is null in OnAfterRender() on browser refresh #66258

@TonyWerten

Description

@TonyWerten

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When I place a component with a reference on a page, it will be not null during the OnAfterRender() function.
If I contnue and refresh the browser with F5, the component reference will be null, after rendering

Expected Behavior

Reference is not null

Steps To Reproduce

  • Blazor wasm client dotnet 10
  • Add component to page, with a reference
  • Put breakpoint in OnAfterRender() and check the reference to the component.
  • Continue and Press F5
  • At breakpoint in OnAfterRender() the reference will be null

Exceptions (if any)

No response

.NET Version

net10

Anything else?

Blazor wasm client dotnet 10
VS2026

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorIncludes: Blazor, Razor Components

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions