Enzyme's shallow() doesn't recognise the component when decorated with both @observer and @inject
So the workaround for this was usually to use @observer(['store1', 'store2']). Since this approach is now deprecated and probably will be removed at some point, this will be quite an issue.
This is the error:
Invariant Violation: Component(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.
As soon as I remove one of the decorators, everything works as expected.
see the recently closed issues
Op vr 9 dec. 2016 15:17 schreef Daniel Leu [email protected]:
So the workaround for this was usually to use @observer(['store1', 'store2']). Since this approach is now deprecated and probably will be removed at some point, this will be quite an issue.
This is the error: Invariant Violation: Component(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.
As soon as I remove one of the decorators, everything works as expected.
— 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/178, or mute the thread https://github.com/notifications/unsubscribe-auth/ABvGhPiusQ9PC6k1KQBLaZ62aPIGeGZXks5rGWLfgaJpZM4LI-s6 .
(on mobile) short answer use .wrappedComponent
Op vr 9 dec. 2016 16:38 schreef Michel Weststrate [email protected]:
see the recently closed issues
Op vr 9 dec. 2016 15:17 schreef Daniel Leu [email protected]:
So the workaround for this was usually to use @observer(['store1', 'store2']). Since this approach is now deprecated and probably will be removed at some point, this will be quite an issue.
This is the error: Invariant Violation: Component(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.
As soon as I remove one of the decorators, everything works as expected.
— 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/178, or mute the thread https://github.com/notifications/unsubscribe-auth/ABvGhPiusQ9PC6k1KQBLaZ62aPIGeGZXks5rGWLfgaJpZM4LI-s6 .
Thank you!