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

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

Open
vfridell opened this issue Sep 15, 2023 · 0 comments

Comments

@vfridell
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant