Skip to content
Discussion options

You must be logged in to vote

despite the codesandbox, I'm not quite sure what the problem is. refetchInterval can be a number, so refetchInterval: 123 is correct, and you'll get no type error here. If I do:

  const result1 = useQueries(
    userIds.map((userId) => {
      return {
        queryKey: ["user", userId],
        queryFn: () => queryFn(userId),
        refetchInterval: "f"
      };
    })
  );

now that type errors with:

Type 'string' is not assignable to type 'number | false | ((data: unknown, query: Query<unknown, unknown, unknown, QueryKey>) => number | false) | undefined'.ts(2345)

which also looks correct. Just because you hover something and it shows any doesn't mean there is an issue with the types.…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@bennettdams
Comment options

@bennettdams
Comment options

@TkDodo
Comment options

@bennettdams
Comment options

@reuelsilva
Comment options

Answer selected by bennettdams
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants