UNPKG

react-native-ui-lib

Version:

<p align="center"> <img src="https://user-images.githubusercontent.com/1780255/105469025-56759000-5ca0-11eb-993d-3568c1fd54f4.png" height="250px" style="display:block"/> </p> <p align="center">UI Toolset & Components Library for React Native</p> <p a

21 lines (16 loc) 498 B
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;