fetch
Need to fetch an endpoint on key stroke, how do you do that?
4 Replies
is your question how to send a query imperatively rather than when the component mounts? if so, look at
enabled
and refetch
here: https://tanstack.com/query/v4/docs/react/reference/useQueryuseQuery | TanStack Query Docs
const {
data,
thanks yeah I ended up doing it with a boolean and useEffect
works good now
using "fetch" didn't made sense so i was trying to find a way to do it the T3 way
Go to know - you can also use useMutation to call an endpoint (tRPC router) - incase the enabled prop way in useQuery doesnt work

did something similar but with useQuery. I'm now trying to understand how pages work in next, i literally went from react/vite to T3 .. I knew some TS so I'm surviving lol