I need to pass a forward ref to a component wrapped with withTracker(), to be able to call a method on the component.
I found quite a number of PRs and issues on the Meteor repo for this, like this one:
meteor:devel
← risetechnologies:ReactForwardRef
opened 07:22AM - 12 Feb 19 UTC
Pass ref to the wrapped component.
This might be a breaking change as:
1. … It requires at least React 16.3
2. Refs targeting `ReactMeteorDataComponent` itself now don't work anymore (I thought of something like `options.forwardRef` for this, but in our large project we do not have even one case where we had to reference `ReactMeteorDataComponent` itself, so I skipped it)
fixes https://github.com/meteor/react-packages/issues/202
fixes https://github.com/meteor/react-packages/issues/189
fixes https://github.com/meteor/react-packages/issues/162
but all seem to point to each other, and it’s pretty unclear if this has ever been implemented (and how). The docs also don’t mention this.
So, how can I actually forward a ref in this scenario?
I could resolve this by updating react-meteor-data
from 1.0.0 to 2.1.0. However, this was only possible by updating the whole Meteor app from 1.8 to 1.10.2, due to lots of dependency mismatches. Not sure if this will have additional side-effects.
Is there a way to do this on older Meteor versions, i.e. with react-meteor-data@1.0.0
?