fetch

Need to fetch an endpoint on key stroke, how do you do that?
4 Replies
cje
cje9mo ago
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/useQuery
K1|ller
K1|ller9mo ago
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
cadams
cadams9mo ago
Go to know - you can also use useMutation to call an endpoint (tRPC router) - incase the enabled prop way in useQuery doesnt work
No description
K1|ller
K1|ller9mo ago
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
Want results from more Discord servers?
Add your server
More Posts
data branching planetscalenew to database stuff, im about to seed a database for a developer environment to test on. when im hCustom onChange function to react-date-pickerI'm trying to use shad's custom date range picker and add it to a form. but i can't seem to pass a cSignalRSeeking help to start SignalR server using Node. Here's my code: (white lie, I've had chatgpt on caWhen to use "src/page/api/doStuff.ts" vs "src/server/api/routers/routerThatDoesStuff.ts"I am trying to get data from a db AFTER I click a button. Correct me if i am wrong - to do this, youNo response returning from api routeI'm making an api route to fetch/create a chatId for a chat room but its not returning any response,❌ Attempted to access a server-side environment variable on the client get's thrown in db.tsHi, I get a weird error in my nextjs application created with create-t3-app. It throws an error thatTailwind - Styles with same name but different value depending on the routeI am working on a monorepo. Each package in the monorepo counts has a route (e.g. the folder /page iFatalClientError - Cannot read properties of undefined (reading 'CUSTOM_INFRA_URL') using RemixHi, when I try to upload a file using UploadButton or UploadDropZone using Remix, the files are uploin the context of websockets is the UPGRADE request redundant now?https://developer.mozilla.org/en-US/docs/Web/HTTP/Protocol_upgrade_mechanism#upgrading_to_a_websocketrying to use uploadthing with my custom useDropzone component?is there any way to use upload ting with my own Dropzone component,instead of uploadthing components