import React, { useImperativeHandle, useRef } from 'react';
function forRef(WrappedComponent) {
    return React.forwardRef((props, ref) => {
        const $Ref = useRef(null);
        useImperativeHandle(ref, () => $Ref.current);
        return React.createElement(WrappedComponent, Object.assign({}, props, { ref: $Ref }));
    });
}
export default forRef;
