A VS Code extension providing helpful code snippets for quickly generating standard React Query (@tanstack/react-query) custom hooks. This helps maintain consistency and speeds up development.
Features
This extension currently includes snippets for:
Standard Data-Fetching Hook (useQuery)
Standard Data-Mutation Hook (useMutation)
How to Use
Ensure this extension ("RQ Hooks") is installed in your VS Code.
Open a .tsx or .ts file where you want to create a new hook.
Type one of the prefixes listed below for the desired snippet.
VS Code's IntelliSense will suggest the snippet. Select it and press Enter or Tab.
The snippet code will be inserted automatically.
Use the Tab key to jump between placeholders and fill in the required values for your specific API.
Available Snippets
Name
Prefixes
Description
React Query Hook
rqh, useQuerySnippet
Generates a useQuery hook for data fetching.
React Mutation Hook
rqm, useMutationSnippet
Generates a useMutation hook for data mutation.
1. React Query Hook
Prefixes:rqh, useQuerySnippet
Description: Creates a comprehensive useQuery hook for fetching data from an API using standard structure.
Placeholders to fill:
HookIdentifier: Your custom hook’s base name (e.g., AdminHospitalLog)
FeatureNameParams: The type for API parameters (e.g., LogHospitalExpenseParams)
FeatureNameResponse: The type for the API response (e.g., HospitalLogExpenseResponse)