Skip to content

Expose abort controller in useAsyncList #2217

@CezCz

Description

@CezCz

🙋 Feature Request

I'd like to be able to abort fetch in useEffect cleanup when my component is detaching.

🤔 Expected Behavior

useAsyncList should expose a method to abort all it's current ongoing fetches.

😯 Current Behavior

Abort is not possible. This causes a following message being thrown to console:
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    📋 Waiting for Sprint

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions