Skip to content

react will deprecate "Throw a Promise" in favor of "use" #605

@PatrykWalach

Description

@PatrykWalach

facebook/react#34032

use can only be used inside hooks. The same applies to throw we can only throw at the top level of a component.

Currently, we throw inside functions like readButDoNotEvaluate, which makes it unclear that these shouldn’t be called outside a component’s top level.

By refactoring to only throw within hooks, we can prepare for deprecation, improve the developer experience, and make it clearer how to make @isograph/react framework agnostic #564

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