react-native-ui-lib
Version:
[](https://stand-with-ukraine.pp.ua)
16 lines • 493 B
JavaScript
import React, { Component } from 'react';
import PanningContext from "./panningContext";
function asPanViewConsumer(WrappedComponent) {
class PanViewConsumer extends Component {
saveRef = r => {
this.contentRef = r;
};
render() {
return <PanningContext.Consumer>
{context => <WrappedComponent ref={this.saveRef} context={context} {...this.props} />}
</PanningContext.Consumer>;
}
}
return PanViewConsumer;
}
export default asPanViewConsumer;