You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This page shows defining a RenderFragment using the older lambda pattern with a __builder parameter:
<h1>Hello, world!</h1>
@RenderWelcomeInfo
<p>Render the welcome info a second time:</p>
@RenderWelcomeInfo@code{privateRenderFragmentRenderWelcomeInfo=__builder=>
{
<p>Welcometoyournewapp!</p>
};
}
But I believe the preferred way to define this RenderFragment is like this:
<h1>Hello, world!</h1>
@RenderWelcomeInfo
<p>Render the welcome info a second time:</p>
@RenderWelcomeInfo@code{privateRenderFragmentRenderWelcomeInfo= @<p>Welcometoyournewapp!</p>;
}
This page shows defining a
RenderFragment
using the older lambda pattern with a__builder
parameter:But I believe the preferred way to define this
RenderFragment
is like this:This page already links to https://learn.microsoft.com/aspnet/core/blazor/performance#define-reusable-renderfragments-in-code which shows the preferred syntax.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: