Skip to content
This repository was archived by the owner on Dec 26, 2025. It is now read-only.
This repository was archived by the owner on Dec 26, 2025. It is now read-only.

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

@luetm

Description

@luetm

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionQuestion about this projectTriageIssue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions