PropsWithRef<P>: "ref" extends keyof P
    ? P extends {
            ref?: infer R;
        }
        ? string extends R
            ? PropsWithoutRef<P> & {
                ref?: Exclude<R, string>;
            }
            : P
        : P
    : P

Ensures that the props do not include string ref, which cannot be forwarded

Type Parameters

  • P