Aspnetcore.docs: Example uses "For internal use only" method

Created on 24 Nov 2020  Â·  6Comments  Â·  Source: dotnet/AspNetCore.Docs

The InputText based on the input event section uses CreateBinder(), which is labeled as "For internal use only."

Please update with a safe alternative. See https://github.com/dotnet/aspnetcore/issues/24883#issuecomment-710099785 for a related discussion.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Blazor P0 Source - Docs.ms doc-bug

All 6 comments

Thanks @mrlife ... Let's ask ..........

@pranavkm @SteveSandersonMS ... The original version of this (it was updated at least once along the way) was a Ryan bit that came at 3.0 Preview 9 ...

Do you want to keep it, replace it, or 🔪💀 _kill it?_ 💀🔪

@SteveSandersonMS can you please look into this and see whether there is an alternative API we can use in this sample? Thanks!

@guardrex Do you remember any details about why the sample was written that way? My first thought is there's no obvious reason to use EventCallback.Factory.CreateBinder here - it looks like it could just use @bind. That is, CustomInputText.razor could be:

@inherits InputText
<input 
    @attributes="AdditionalAttributes" 
    class="@CssClass" 
    @bind="CurrentValueAsString"
    @bind:event="oninput" />

Do you know of some reason that doesn't work?

It looks like it was just a workaround back when Ryan sent it over in August, 2019 (ages ago during Preview 9) ...

https://github.com/dotnet/AspNetCore.Docs/issues/13912

OK cool, looks like it could be updated then!

Thank you all, it works great!

Was this page helpful?
0 / 5 - 0 ratings