Skip to content

Manually triggering new requests #1082

@vinay-deshmukh

Description

@vinay-deshmukh

In my application, I don't want useSWR hook to automatically call the fetcher function. I want to call it in one of my event handlers.

What did you try?

  • I tried setting refetchOnMount as false, but then on the next render, the fetch request happened anyway.

  • Tried making isPaused() return true always, but this means mutate() calls also don't work.

##Expected behaviour

Flag/boolean config that disables "auto fetching", and only fetches when user calls mutate().

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions