Skip to content
This repository was archived by the owner on Oct 5, 2024. It is now read-only.

Cleaning up data fetching on mount #43

@Aztriltus

Description

@Aztriltus

In the DeployedSiteCard.tsx component, it's using useEffect to do an async/await fetch to getPages. In conjunction to #42, I think we can improve the resilience by cleaning up the data fetching on mount.

In situations where the component is unmounted before the fetch is completed, it might result in some issues. I think it'll be good to try using AbortController to cleanup the fetch. I saw a good example here which also uses try/catch block: https://dev.to/pallymore/clean-up-async-requests-in-useeffect-hooks-90h

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