
Security News
New React Server Components Vulnerabilities: DoS and Source Code Exposure
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.
@steute.dev/create-react-query-wrapper
Advanced tools
I have some opinions!
useQuery/useMutation all willy-nilly wherever I wantThis library aims to get rid of a ton of boilerplate code and create an opinionated way to manage react-query queries! These utilities won't work for every use case, but they should work for most of them!
const fetchTodos = async (userId: string): Promise<Todo[]> => fetch(`/user/${userId}/todos`);
const useTodos = <TSelected = Todo[]>(userId: string, options: UseQueryOptions<Todo[], unknown, TSelected> = {}) => {
return useQuery<Todo[], unknown, TSelected>(['todos', userId], () => fetchTodos(userId));
}
// some other code
queryClient.invalidateQueries(['todos', userId]); // notice the duplicated code and magic string
// OR to invalidate all of them
queryClient.invalidateQueries(['todos']);
Now, this a simple example with simple query key generation and parameters. The types are a little tricky to understand already though!
const fetchTodos = async (userId: string): Promise<Todo[]> => fetch(`/user/${userId}/todos`);
const useTodos = createQueryWrapper(fetchTodos, 'todos');
// some other code
queryClient.invalidateQueries(useTodos.getQueryKey(userId)); // now query keys are more managable!
// OR to invalidate all of them
queryClient.invalidateQueries(useTodos.getQueryKey());
The hook returned here is completely type safe and supports all of the react-query options!
Documentation will come soon, use the source code for now!
FAQs
## What is this?
The npm package @steute.dev/create-react-query-wrapper receives a total of 0 weekly downloads. As such, @steute.dev/create-react-query-wrapper popularity was classified as not popular.
We found that @steute.dev/create-react-query-wrapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.