import React, { forwardRef } from "react";
// Declare a type that works with generic components
type FixedForwardRef = <T, P = {}>(
render: (props: P, ref: React.Ref<T>) => React.ReactElement
) => (props: P & React.RefAttributes<T>) => React.ReactElement;
// Cast the old `forwardRef` to the new one
export const fixedForwardRef =
forwardRef as FixedForwardRef;
标签:typescript,ReactElement,React,forwardRef,props,type From: https://www.cnblogs.com/Answer1215/p/17596332.html