-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(react-router): Pass SearchParamError#cause in validateSearch #3155
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
fix(react-router): Pass SearchParamError#cause in validateSearch #3155
Conversation
can you add a test please? |
Thanks for the suggestion. Adding the test for |
View your CI Pipeline Execution ↗ for commit 3beb0d0.
☁️ Nx Cloud last updated this comment at |
What
Ensure that
SearchParamError#cause
contains the original parsing error thrown/returned by thevalidateSearch
implementation configured by the user. Notable example: passing valibot schema directly without an adapter.Why
It's useful to know what happened, because the error can be accessed with
Route.errorComponent
orRoute.onError
. Also for consistency with other implementations ofvalidateSearch
.How
cause
to theSearchParamError
thrown byvalidateSearch
SearchParamError
in anotherSearchParamError
~standard
, validator fn, validator obj