How to Run JS Interop on an Element That Was Just Rendered Conditionally in Blazor
Blazor has no nextTick(), but you can build one: a TaskCompletionSource completed in OnAfterRenderAsync. Here is why the @ref is null or stale right after you flip an @if, which common workarounds fail, and a NextRenderAsync helper verified on .NET 10 in both InteractiveServer and InteractiveWebAssembly.