Skip to content

Missing example of passing state from card to page via react router location #3

@vfridell

Description

@vfridell

None of these example have card->page interactions with state passing. Please add.

The Experience SDK docs say "Include the optional state object if you want to pass variables between a card and a page. This works only when using the route parameter. It uses the react-router-dom's location object to get the state". Using the route and state parameters together in navigateToPage I can transition from card to page. But no luck getting the state to pass. It's not in the props and useLocation() throws an exception "Cannot read properties of undefined (reading 'location')". Following the docs on react router doesn't work because they don't fit the Experience SDK paradigm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions