Closed zengqingzhuang closed 4 years ago
Please create a small reproduction.
Yes have the same issue:
We provide same component twice, because we use it for different stores, now it starts throwing errors. its quite annoying i had to downgrade to keep it working.
reproducable by calling observer() twice on same class method but doing it manually:
var observedClass1 = observer(ClassName);
var observedClass2 = observer(ClassName);
It would be nice to at least be able to disable this error/warning.
"We provide same component twice, because we use it for different stores"
Why do you need to wrap a component twice in observer twice because you use it for two different stores? Please provide some example code why the warning wouldn't be correct in your case.
On Mon, Jul 27, 2020 at 3:04 PM Joël Harkes notifications@github.com wrote:
It would be nice to at least be able to disable this error/warning.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mobxjs/mobx-react/issues/887#issuecomment-664416127, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN4NBADBVTCVVISPC5TVE3R5WCNNANCNFSM4PINWIYA .
The warning is fine. The real problem is getDisplayName (https://github.com/mobxjs/mobx-react/blob/376bff72d84ae8d342c55d1fb25ff81a223624d2/src/observerClass.ts#L26) is passed with a undefined value; and it is not properly handled.
We will publish a fix soon, it was merely an oversight. Stick to the previous version for now, please.
Just release 6.2.4. Thanks for reporting!