Skip to content

Latest version of 'retry' no longer includes error #638

@onionhammer

Description

@onionhammer

Just tried out upgrading to 2.4.0, and I see now that I can no longer check the error before retrying?

This was my logic

const queryConfig: ReactQueryProviderConfig<any> = {
    refetchOnWindowFocus: false,
    suspense: true,
    retry: (failures, err) => {
        if ("status" in err && err.status === 401)
            return false;
        else
            return failures < 5;
    }
};

Not sure how I would reproduce this with the new API, since the onError expects void, retryDelay does not give an error, and retry no longer takes a function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions