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

Send the state object with navigate or setLocation #342

Closed
kripashank opened this issue Sep 19, 2023 · 1 comment
Closed

Send the state object with navigate or setLocation #342

kripashank opened this issue Sep 19, 2023 · 1 comment
Labels
V3 Features that won't be released in v2, but planned for the next major release

Comments

@kripashank
Copy link

HI ,

Can anyone suggest how to send the state with the useLocation or navigate in wouter?,

Something like below in react router,

For sending:

navigate("/success", {
state: {
stripeData: res.data,
products: cart,
},
});

For Receiving:

import { useLocation } from "react-router-dom";
const location = useLocation();
const data = location.state.stripeData;
const cart = location.state.products;

@molefrog molefrog added the V3 Features that won't be released in v2, but planned for the next major release label Oct 9, 2023
@molefrog
Copy link
Owner

molefrog commented Oct 9, 2023

There is some work being done in #325, but we are also working on the next major release where this feature has already been implemented. See #349

Also, this seems to be a duplicate of #316

@molefrog molefrog closed this as completed Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V3 Features that won't be released in v2, but planned for the next major release
Projects
None yet
Development

No branches or pull requests

2 participants