Skip to content
This repository was archived by the owner on Dec 31, 2020. It is now read-only.
This repository was archived by the owner on Dec 31, 2020. It is now read-only.

Using observer with react hooks does not work #594

@barbalex

Description

@barbalex

https://codesandbox.io/s/7z9yok8mn1

This error occurs:

Hooks can only be called inside the body of a function component.

There is already an issue for this (#591) but it was closed as the author wants to wait for a version of mobx-react that uses hooks itself.

Although I am also looking forward to that my intention is to try out hooks in my projects and start using them, even if mobx-react itself can not yet be switched.

This is not possible as observer causes the above error.

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