Here's the definition of createEnumParam:
export const createEnumParam = <T extends string>(
enumValues: T[]
): QueryParamConfig<string | null | undefined, T | null | undefined>
Is there any reason why return type of it isn't QueryParamConfig<T | null | undefined, T | null | undefined> (the first generic changed from string | null | undefined to T | null | undefined?
For me the latter seems more correct, as it allows strong-typing of setParam function .