Skip to content

useAsync T cannot be null #227

Closed
@jbojcic1

Description

@jbojcic1

Currently useAsync is defined as useAsync<T extends {}> which means it cannot be null or undefined when using ts strict mode.

Example: https://codesandbox.io/s/react-typescript-9x4j1

This makes it impossible to use promise which returns SomeData | null

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