mobxjs / mobx-react

React bindings for MobX
https://mobx.js.org/react-integration.html
MIT License
4.85k stars 349 forks source link

Cannot read property 'prototype' of undefined when import useObserver #796

Closed Ridermansb closed 5 years ago

Ridermansb commented 5 years ago

When I import useObserver I'm getting this error:

image

I tried both way ...

import { useObserver } from "mobx-react-lite";

or

import { useObserver } from "mobx-react";

Full example here: https://codesandbox.io/s/example-preact-mobx-state-tree-with-hooks-yk7o2

danielkcz commented 5 years ago

Um, based on error stack it's preact-compat library related issue, so please ask there.

I know there was some rumor, that mobx-preact is no longer needed and mobx-react should used instead, but I don't believe it's true ... https://github.com/mobxjs/mobx-preact/issues/18

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or questions.