@pdf-viewer/react
Version:
A react-pdf-viewer component for React and Next.js. Suitable for react-pdf document.
6 lines (5 loc) • 463 B
TypeScript
import { ForwardRefExoticComponent, RefAttributes, PropsWithoutRef, Ref, ReactElement } from 'react';
type WithRefRender<R extends HTMLElement, P> = (props: PropsWithoutRef<P>, ref: Ref<R>) => ReactElement | null;
type WithRefComponent<R extends HTMLElement, P> = ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<R>>;
export declare const withRef: <R extends HTMLElement, P = object>(render: WithRefRender<R, P>) => WithRefComponent<R, P>;
export {};