--- lang: ja-jp breaks: true --- # Blazor `InteractiveServerRenderMode(prerender: true)` 時、 `OnInitializedSubAsync` の呼び出し状況 2024-10-30 ## 大前提 > コンポーネントの初期化 (OnInitialized{Async}) > https://learn.microsoft.com/ja-jp/aspnet/core/blazor/components/lifecycle?view=aspnetcore-8.0#component-initialization-oninitializedasync   ## 検証 * URL直打ち:2回呼ばれる。 * メニューからの遷移:1回だけ呼ばれる。 * メニューから他の画面に移動後、戻るボタン:1回だけ呼ばれる。 * `NavigationManager.NavigateTo` で `forceLoad: true` を設定して遷移:2回呼ばれる。 * `NavigationManager.NavigateTo` で `forceLoad: false` を設定して遷移:1回だけ呼ばれる。 * `NavigationManager.NavigateTo` で `forceLoad: true` を設定して遷移後、戻るボタン:2回呼ばれる。 * `NavigationManager.NavigateTo` で `forceLoad: false` を設定して遷移後、戻るボタン:1回だけ呼ばれる。 * ###### tags: `Blazor` `InteractiveServerRenderMode(prerender: true)` `OnInitializedSubAsync`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up