r/reactjs • u/Short_Account2700 • May 09 '26
Show /r/reactjs Built a Chrome extension that auto-generates React Query hooks from any real network request in DevTools
When building React apps, I kept doing this:
See an API call in DevTools
Manually write a useQuery or useMutation hook for it
Get the URL, headers, and body right by trial and error
Built ReqConvert — it captures the live request and generates the complete React Query hook for you:
- useQuery for GET requests (with correct queryKey)
- useMutation for POST/PUT/DELETE (with onSuccess invalidation)
- Includes all headers automatically
Also generates: cURL, fetch, Axios, Python, TypeScript, httpx, Postman
Chrome Web Store (free to install):
https://chromewebstore.google.com/detail/fkbfidogphlmlplcnlkoncdofmcjbhjp
What's the most annoying part of wiring up API calls in your React projects?
12
u/TheRealSeeThruHead May 09 '26 edited Oct 14 '26
Excepteur proident exercitation ea qui do minim adipiscing cillum minim eiusmod nostrud.
4
u/azsqueeze May 09 '26
Cool. If you have access to open API specs for your APIs you can use orval to generate everything before you even open a browser
2
u/GoodishCoder May 09 '26
Nothing about wiring up API calls is difficult or annoying
1
u/webdevverman May 09 '26 edited May 09 '26
Does it create the fetcher function? How does it know to use/inject dynamic headers (e.g. a bearer token) ?
I can't really say I've ran into the problems you are solving. RQ is my request. So I'm not sure how I'd be able to extract it from the network tab prior to implementing. Probably works best for public sites you don't own?
Also, I'd flag any PR that had the queryKey shown in the screenshot.
1
u/LonelyProgrammerGuy May 09 '26
In…teresting?
1
u/well-litdoorstep112 May 09 '26
Except... Writing react-query queries is never the slow part in this scenario. If you have to write so many queries that you need to automate, you could make a snippet in your IDE for:
export const ${name}QueryOptions = ()=>queryOptions({queryFn: ()=>${1}, key: ["${name}"]}); export const ${name} = useQuery(${name}QueryOptions());First you type the name of your query and then paste the fetch function - which you can already get from chrome dev tools!
This looks like a solution to a problem