Skip to content

Passing properties through a <Page ...> element. #98

Closed
@chrisdew

Description

@chrisdew

I have some state in the top level "App" element (the one which renders <Pages ...>.

At the moment, the only top-level state is "logged_in", which is either null or contains the logged-in user's name. (The server also checks whether a user is logged in for sever-side page renders and REST API calls.)

I'm thinking of the top-level element's state as a client-side "session" - is this a problem?

I'd like to pass the "logged_in" state down into each page as a property, but to do that I think I'd somehow need to pass it through the <Page ...> elements.

Is there a method to do this, or is there a better approach to maintaining client-side "session" scope?

P.S. Another thing I'd like to pass to the pages (or rather just the Log In page) is a call-back to change the App logged_in state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions