forwardRef.d.ts 649 Bytes
Newer Older
Sangjune Bae's avatar
Sangjune Bae committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// TypeScript Version: 3.0

declare module '@restart/context/forwardRef' {
  import * as React from 'react';

  interface ForwardRefOptions<TProps> {
    displayName?: string;
    propTypes?: React.ValidationMap<TProps>;
    defaultProps?: Partial<TProps>;
    allowFallback?: boolean;
  }

  function forwardRef<TRef, TProps>(
    renderFn: (
      props: TProps & { children?: React.ReactNode },
      ref: React.Ref<TRef> | null,
    ) => React.ReactElement<any> | null,
    options?: ForwardRefOptions<TProps>,
  ): React.ForwardRefExoticComponent<
    React.PropsWithRef<TProps> & React.RefAttributes<TRef>
  >;

  export default forwardRef;
}