freeatnet
freeatnet
TTCTheo's Typesafe Cult
Created by freeatnet on 4/22/2024 in #questions
React Query extension type helpers?
I'm building an SDK that will provide hooks that wrap react-query v5 hooks. I'd like to customize some of the parameter and result shapes, but keep the amazing DX react-query provides, so I'm looking for a development library that would make that easier. I've found that it's super easy to break some of the more intricate parts of react-query types. For example, it turns out you can't use Omit over a type union like UseMutationResult, otherwise it'll break the isSuccess <-> data: TData coherence (see: https://stackoverflow.com/a/57103940/215024). To spare myself some future headaches, I'd love to find something that would have utilities for building on top of React Query hooks. Does anyone have any suggestions?
2 replies