Skip to content

useFunctionQuery from documentation cause infinite loop #81

@powah

Description

@powah

I liked the idea for key to use a function itself used for fetching the data because of no need to use strings or additional constants. Tried to use it from documentation and it triggers infinite rapid fetching. A function reference is stable (exported from separate module) so something inside custom hook needs to be memoized? Any guidance how to solve this?

I'm talking about this custom hook:

function useQuery(functionTuple, options) { const [queryFn] = Array.isArray(functionTuple) ? functionTuple : [functionTuple]; return useReactQuery(functionTuple, queryFn, options); }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions