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
Copy file name to clipboardExpand all lines: aspnetcore/blazor/components/index.md
+42Lines changed: 42 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -439,6 +439,8 @@ In the following example, the `RenderFragmentChild` component has a `ChildConten
439
439
440
440
> [!IMPORTANT]
441
441
> The property receiving the <xref:Microsoft.AspNetCore.Components.RenderFragment> content must be named `ChildContent` by convention.
442
+
>
443
+
> [Event callbacks](xref:blazor/components/event-handling#eventcallback) aren't supported for <xref:Microsoft.AspNetCore.Components.RenderFragment>.
442
444
443
445
The following `RenderFragmentParent` component provides content for rendering the `RenderFragmentChild` by placing the content inside the child component's opening and closing tags.
444
446
@@ -474,6 +476,18 @@ Alternatively, use a [`foreach`](/dotnet/csharp/language-reference/keywords/fore
474
476
}
475
477
```
476
478
479
+
> [!NOTE]
480
+
> Assignment to a <xref:Microsoft.AspNetCore.Components.RenderFragment> delegate is only supported in Razor component files (`.razor`):
> For more information, see <xref:blazor/performance#define-reusable-renderfragments-in-code>.
490
+
477
491
For information on how a <xref:Microsoft.AspNetCore.Components.RenderFragment> can be used as a template for component UI, see the following articles:
478
492
479
493
* <xref:blazor/components/templated-components>
@@ -1506,6 +1520,8 @@ In the following example, the `RenderFragmentChild` component has a `ChildConten
1506
1520
1507
1521
> [!IMPORTANT]
1508
1522
> The property receiving the <xref:Microsoft.AspNetCore.Components.RenderFragment> content must be named `ChildContent` by convention.
1523
+
>
1524
+
> [Event callbacks](xref:blazor/components/event-handling#eventcallback) aren't supported for <xref:Microsoft.AspNetCore.Components.RenderFragment>.
1509
1525
1510
1526
The following `RenderFragmentParent` component provides content for rendering the `RenderFragmentChild` by placing the content inside the child component's opening and closing tags.
1511
1527
@@ -1541,6 +1557,18 @@ Alternatively, use a [`foreach`](/dotnet/csharp/language-reference/keywords/fore
1541
1557
}
1542
1558
```
1543
1559
1560
+
> [!NOTE]
1561
+
> Assignment to a <xref:Microsoft.AspNetCore.Components.RenderFragment> delegate is only supported in Razor component files (`.razor`):
> For more information, see <xref:blazor/performance#define-reusable-renderfragments-in-code>.
1571
+
1544
1572
For information on how a <xref:Microsoft.AspNetCore.Components.RenderFragment> can be used as a template for component UI, see the following articles:
1545
1573
1546
1574
* <xref:blazor/components/templated-components>
@@ -2439,6 +2467,8 @@ In the following example, the `RenderFragmentChild` component has a `ChildConten
2439
2467
2440
2468
> [!IMPORTANT]
2441
2469
> The property receiving the <xref:Microsoft.AspNetCore.Components.RenderFragment> content must be named `ChildContent` by convention.
2470
+
>
2471
+
> [Event callbacks](xref:blazor/components/event-handling#eventcallback) aren't supported for <xref:Microsoft.AspNetCore.Components.RenderFragment>.
2442
2472
2443
2473
The following `RenderFragmentParent` component provides content for rendering the `RenderFragmentChild` by placing the content inside the child component's opening and closing tags.
2444
2474
@@ -2474,6 +2504,18 @@ Alternatively, use a [`foreach`](/dotnet/csharp/language-reference/keywords/fore
2474
2504
}
2475
2505
```
2476
2506
2507
+
> [!NOTE]
2508
+
> Assignment to a <xref:Microsoft.AspNetCore.Components.RenderFragment> delegate is only supported in Razor component files (`.razor`):
Copy file name to clipboardExpand all lines: aspnetcore/blazor/performance.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -167,6 +167,9 @@ You might be factoring out child components purely as a way of reusing rendering
167
167
168
168
As demonstrated in the preceding example, components can emit markup from code within their `@code` blocks and outside of them. The <xref:Microsoft.AspNetCore.Components.RenderFragment> delegate must accept a parameter called `__builder` of type <xref:Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder> so that the Razor compiler can produce rendering instructions for the fragment.
169
169
170
+
> [!NOTE]
171
+
> Assignment to a <xref:Microsoft.AspNetCore.Components.RenderFragment> delegate is only supported in Razor component files (`.razor`), and [event callbacks](xref:blazor/components/event-handling#eventcallback) aren't supported.
172
+
170
173
To make <xref:Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder> code reusable across multiple components, declare the <xref:Microsoft.AspNetCore.Components.RenderFragment> delegate as `public` and `static`:
171
174
172
175
```razor
@@ -923,6 +926,9 @@ You might be factoring out child components purely as a way of reusing rendering
923
926
924
927
As demonstrated in the preceding example, components can emit markup from code within their `@code` blocks and outside of them. The <xref:Microsoft.AspNetCore.Components.RenderFragment> delegate must accept a parameter called `__builder` of type <xref:Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder> so that the Razor compiler can produce rendering instructions for the fragment.
925
928
929
+
> [!NOTE]
930
+
> Assignment to a <xref:Microsoft.AspNetCore.Components.RenderFragment> delegate is only supported in Razor component files (`.razor`), and [event callbacks](xref:blazor/components/event-handling#eventcallback) aren't supported.
931
+
926
932
To make <xref:Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder> code reusable across multiple components, declare the <xref:Microsoft.AspNetCore.Components.RenderFragment> delegate as `public` and `static`:
927
933
928
934
```razor
@@ -1663,6 +1669,9 @@ You might be factoring out child components purely as a way of reusing rendering
1663
1669
1664
1670
As demonstrated in the preceding example, components can emit markup from code within their `@code` blocks and outside of them. The <xref:Microsoft.AspNetCore.Components.RenderFragment> delegate must accept a parameter called `__builder` of type <xref:Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder> so that the Razor compiler can produce rendering instructions for the fragment.
1665
1671
1672
+
> [!NOTE]
1673
+
> Assignment to a <xref:Microsoft.AspNetCore.Components.RenderFragment> delegate is only supported in Razor component files (`.razor`), and [event callbacks](xref:blazor/components/event-handling#eventcallback) aren't supported.
1674
+
1666
1675
To make <xref:Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder> code reusable across multiple components, declare the <xref:Microsoft.AspNetCore.Components.RenderFragment> delegate as `public` and `static`:
0 commit comments