Skip to content

Enhance nullability support for TValue in EventCallback#67237

Open
Yuvan111 wants to merge 3 commits into
dotnet:mainfrom
Yuvan111:fix-54502-null-eventcallback
Open

Enhance nullability support for TValue in EventCallback#67237
Yuvan111 wants to merge 3 commits into
dotnet:mainfrom
Yuvan111:fix-54502-null-eventcallback

Conversation

@Yuvan111

Copy link
Copy Markdown

Enhance nullability support for TValue in EventCallback

Description

Updated InvokeAsync to use non-nullable TValue, supporting both T and T? at usage level while enforcing stricter type safety. No breaking change—nullable values passed to non-nullable types will now throw runtime errors.

API Old Type New Type
InvokeAsync TValue? TValue

Output gif:

Code_ErmcrLoyAG

Fixes #54502

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jun 16, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Thanks for your PR, @Yuvan111. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@Yuvan111 Yuvan111 marked this pull request as ready for review June 16, 2026 10:29
@Yuvan111 Yuvan111 requested a review from a team as a code owner June 16, 2026 10:29
@javiercn javiercn added the area-blazor Includes: Blazor, Razor Components label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance null safety and compiler warnings for EventCallback<T>

2 participants