New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return the created component from BrowserRenderer.AddComponent #1722

AndreasTruetschel opened this Issue Nov 25, 2018 · 1 comment


None yet
2 participants

AndreasTruetschel commented Nov 25, 2018

I have a sceanrio that I need to render a RenderFragment into a given <div> element, provided by javascript. For this, I create a component to wrap my RenderFragment and render it via an instance of the BrowserRenderer. The problem is that I cannot pass the concrete RenderFragment to the component rendered by the BrowserRenderer. The easiest solution is to return the created component from the AddComponent method of the BrowserRenderer.

The concrete scenario is to draw arbitrary content into a leaflet div-icon.

This could also be used to pass the entry assembly into the router component without the workaround of the App component.

var router = app.AddComponent<Router>("app");
router.EntryAssembly = Assembly.GetEntryAssembly();

This comment has been minimized.


SteveSandersonMS commented Nov 26, 2018

I think a preferred solution would be for BrowserRenderer's AddComponent method to get an extra overload that lets you pass in a ParameterCollection for the new root component you're adding. I'm adding this feature request as a note on #1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment