diff --git a/Documentation/docusaurus/docs/razor-component/complex-component-use.md b/Documentation/docusaurus/docs/razor-component/complex-component-use.md index de90b48..6c9fc28 100644 --- a/Documentation/docusaurus/docs/razor-component/complex-component-use.md +++ b/Documentation/docusaurus/docs/razor-component/complex-component-use.md @@ -78,12 +78,19 @@ public partial class Index private List Recipes { get; set; } = new List(); - protected override async Task OnInitializedAsync() + protected override async Task OnAfterRenderAsync(bool firstRender) { - await base.OnInitializedAsync(); + base.OnAfterRenderAsync(firstRender); + + if (!firstRender) + { + return; + } Items = await DataService.List(0, await DataService.Count()); Recipes = await DataService.GetRecipes(); + + StateHasChanged(); } } ``` diff --git a/Documentation/docusaurus/i18n/fr/docusaurus-plugin-content-docs/current/razor-component/complex-component-item.md b/Documentation/docusaurus/i18n/fr/docusaurus-plugin-content-docs/current/razor-component/complex-component-item.md index 0e19111..c824c40 100644 --- a/Documentation/docusaurus/i18n/fr/docusaurus-plugin-content-docs/current/razor-component/complex-component-item.md +++ b/Documentation/docusaurus/i18n/fr/docusaurus-plugin-content-docs/current/razor-component/complex-component-item.md @@ -96,7 +96,7 @@ public partial class CraftingItem Il est possible de créer aussi des fichiers de style CSS directement pour notre composant, ce fichier sera automatiquement rendu avec notre composant. -```css title="Components/CraftingItem.razor.cs" +```css title="Components/CraftingItem.razor.css" .item { width: 64px; height: 64px; diff --git a/Documentation/docusaurus/i18n/fr/docusaurus-plugin-content-docs/current/razor-component/complex-component-use.md b/Documentation/docusaurus/i18n/fr/docusaurus-plugin-content-docs/current/razor-component/complex-component-use.md index a8d74a1..7cbcbd3 100644 --- a/Documentation/docusaurus/i18n/fr/docusaurus-plugin-content-docs/current/razor-component/complex-component-use.md +++ b/Documentation/docusaurus/i18n/fr/docusaurus-plugin-content-docs/current/razor-component/complex-component-use.md @@ -78,12 +78,19 @@ public partial class Index private List Recipes { get; set; } = new List(); - protected override async Task OnInitializedAsync() + protected override async Task OnAfterRenderAsync(bool firstRender) { - await base.OnInitializedAsync(); + base.OnAfterRenderAsync(firstRender); + + if (!firstRender) + { + return; + } Items = await DataService.List(0, await DataService.Count()); Recipes = await DataService.GetRecipes(); + + StateHasChanged(); } } ```