RTK Query: Async input validation #3001
Unanswered
ThomasRutzer
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi , I am pretty new to RTK Query. We have an app that uses React Hook Forms and inputs with async validations. I am wondering how RTK Query could be used in this setup.
Would it make sense to use the
trigger
returned by useLazyQuery and call it in thevalidate
parameter? Then, at least we can make use of the RTK caching mechanism.Or would you rather, since it's not related to the redux store, make a fetch which is not made with RTK Query in this case to trigger async validation? Would it then make sense to use fetchbaseQuery to unify fetch calls? Is it meant to be used outside of an
createApi
definition?Beta Was this translation helpful? Give feedback.
All reactions