Replies: 1 comment 1 reply
-
Yes, we now forward the ref automatically: mobx/packages/mobx-react/src/inject.ts Lines 19 to 30 in f0e066f I assume React.forwardRef did not exist or it just wasn't possible for other reason at that time . For completeness:https://github.com/mobxjs/mobx-react/blob/f8302d81aee6795dd4b042e7408d8f2d38912d03/src/inject.js#L36-L73 EDIT: Not sure what you mean by "wrappedComponent not found", but the component should still be also available as mobx/packages/mobx-react/src/inject.ts Line 37 in f0e066f |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have just finished the mobx 4 to mobx 6 migration, and I noticed a difference in behavior.
In the image below we are rendering a component called
BeSelectorField
and we keep a reference to this component inside a member calledfieldHasPopup
.The
BeSelectorField
is a class component with the annotation@inject
.In Mobx 4, the reference
fieldHasPopup
was anInjector
, and to access the component itself we had to dofieldHasPopup.wrappedComponent
.Since we migrated to Mobx 6,
fieldHasPopup
is directly an instance ofBeSelectorField
.Changing the syntax is not a issue, but I just want to check with you that this difference is expected. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions