I'm using ReactNativeZoomableViewWithGestures and I'd like to be able to call .zoomTo() and .moveBy(). However, there isn't a way to use a ref with the inner ReactNativeZoomableView currently. Here's a simple example of how I'd expect this to work:
I'd be happy to make a PR with the following additions to ReactNativeZoomableViewWithGestures.tsx if this makes sense:
class ReactNativeZoomableViewWithGestures extends React.Component<...> {
// ...
render() {
return (
<ReactNativeZoomableView
ref={this.props.innerRef} // add a ref to ReactNativeZoomableView
{...this.props}
onShiftingEnd={this._onShiftingEnd}
/>
);
}
}
// Forward a ref as a prop since this is a class component
export default React.forwardRef<ReactNativeZoomableView | null>((props, ref) => (
<ReactNativeZoomableViewWithGestures innerRef={ref} {...props} />
));
I'm using ReactNativeZoomableViewWithGestures and I'd like to be able to call
.zoomTo()
and.moveBy()
. However, there isn't a way to use a ref with the innerReactNativeZoomableView
currently. Here's a simple example of how I'd expect this to work:I'd be happy to make a PR with the following additions to
ReactNativeZoomableViewWithGestures.tsx
if this makes sense: