import React, { PureComponent } from 'react'; import PropTypes, { InferProps } from 'prop-types'; import { requireNativeComponent, ViewPropTypes, Platform } from 'react-native'; const propTypes = { document: PropTypes.string.isRequired, ...ViewPropTypes, } // Generates the prop types for TypeScript users, from PropTypes. type PDFViewCtrlProps = InferProps; export class PDFViewCtrl extends PureComponent { static propTypes = propTypes; render() { return ( ) } } const name = Platform.OS === 'ios' ? 'RNTPTPDFViewCtrl' : 'RCTPDFViewCtrl'; const RCTPDFViewCtrl = requireNativeComponent(name);