React component's generics lost when use forwardRef method. It is a bug. Solution: Use the fixed fowardRef function type to override the original one.

import React from "react";

type FixedForwardRef = <T, P = {}>(
  render: (props: P, ref: React.Ref<T>) => React.ReactElement | null
) => (props: P & React.RefAttributes<T>) => React.ReactElement | null;

const forwardRef = React.forwardRef as FixedForwardRef;