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

doc: await is necessary for throw redirectWith... #33

Open
tats-u opened this issue Dec 9, 2024 · 1 comment
Open

doc: await is necessary for throw redirectWith... #33

tats-u opened this issue Dec 9, 2024 · 1 comment

Comments

@tats-u
Copy link

tats-u commented Dec 9, 2024

I got strange errors when I threw redirectWith... without await in React Router v7.
RR says 500 or an error whose message is [[Object: Promise]].
These errors vanished after I added await to every throw redirectWith....
dataWith... don't require await.

@AlemTuzlak
Copy link
Contributor

await is indeed required when throwing because you don't throw the response but rather the promise and that messes up react-router. I'll add this to the docs

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

2 participants