Skip to content

SWR should throw an error when suspense is enabled but key is not ready #1359

Closed
@shuding

Description

@shuding

Related to #339. When the suspense option is enabled, SWR can not return any value to continue rendering, neither throwing any promise if it can't fetch. This includes 2 situations:

  1. suspense: true and key is falsy.
  2. suspense: true and fetcher is null.

In both cases SWR should throw an error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions