import React, { forwardRef, ComponentType, Component } from 'react'; // import { ICaptchaProps } from './captcha'; function withRef(WrappedComponent: ComponentType) { // const HOC: React.FC = ({ forwardedRef, ...restProps }) => { // return ( // // ) // } // return forwardRef((props, ref: any) => { // console.log('props:', props); // return ( // // ) // }) class HOC extends Component { render() { const { forwardedRef, ...restProps } = this.props; return ( ) } } return forwardRef((props: T, ref) => { return ( ) }) } export default withRef;