Closed Krzysztof318 closed 2 years ago
Hi,
PersistentComponentState is used in https://github.com/jdtcn/HybridBlazor/blob/715eeb0e0d2e2a113f37fad0f9595b57299b79ae/HybridBlazor/Client/Pages/FetchData.razor#L43
Prerendering enabled too https://github.com/jdtcn/HybridBlazor/blob/715eeb0e0d2e2a113f37fad0f9595b57299b79ae/HybridBlazor/Server/Pages/_Host.cshtml#L29
In general, the whole idea of the project is to have interaction when WASM is not loaded yet.
Ok, thanks for replies.
Hi, I have one question more. When blazor is using WebAsssemblyPrerendered then PersistentComponentState avoided execute ForecastService.GetForecastAsync when switched from static files to WASM. In your solution PersistentComponentState works only for server mode. When page is switched to WASM then ForecastService.GetForecastAsync is invoked again. Does it is possible to persist state with PersistentComponentState between server and wasm in your solution?
Surely this is possible, but it is hardly easy to do, I have not tried it. I don't understand why use WebAssemblyPrerendered because prerendering will already be done in ServerPrerendered mode.
You can also look towards the https://github.com/servicetitan/Stl.Fusion library if you need to manage complex state
Thanks for help. Btw. I don't want to use WebAssemblyPrerendered. I puted this as example to compare with your solution.
Hi, I like to know does you have plan to change solution to use new was prerender which is available in NET 6 and persist state component?
NET 6 Wasm prerendered has one disadvantage against your solution. Page is static until WASM is loaded, user can't interact. Did you analized it is possible use new NET 6 solution and have interaction when WASM is not loaded yet?