Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Is it possible to access the current RenderTreeBuilder in a Blazor Razor file, or make a Component that doesn't change @key scope?

$
0
0

I'd like to write an EditorFor extension for Blazor, so in a .razor file you could do this

@Editor.For(Model.Address);

The problem is that I shouldn't new-up a component instance of a component in that code, but use RenderTreeBuilder.OpenComponent<TComponent>. But I can't see a way of getting hold of the current RenderTreeBuilder from inside a .razor file.

Does anyone have any ideas for what I could try?

I don't want to make this an <EditorFor> Component because that would change the scope of @key and would sometimes result in large render tree diffs when updating the DOM - unless there is a way to use OpenComponent<T> without changing the @key scope?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>