Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Does accessing session storage work in OnInitializedAsync with render mode Server(prerender=false)? #81

Open
luetm opened this issue Jan 30, 2024 · 0 comments
Labels
Question Question about this project Triage Issue needs to be triaged

Comments

@luetm
Copy link

luetm commented Jan 30, 2024

I read through the documentation, where you say:

NOTE: Due to pre-rendering in Blazor Server you can't perform any JS interop until the OnAfterRender lifecycle method.

Now, I really don't like that because in my app I often have to do query data based on stuff in session storage (e.g. currently selected patient). Only being able to decide which patient I want to query data for in OnAfterRenderAsync would make my app slow, because just after rendering I would load data in that changes everything again.

Since I don't prerender, I thought I'd try to access session storage in OnInitializedAsync, which ... actually worked. Is this just a fluke or can I access session (and in extension local) storage in OnInitializedAsync when I don't prerender?

Thank you for the great library!
luetm

@luetm luetm added Question Question about this project Triage Issue needs to be triaged labels Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Question about this project Triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant