已经安装 "@types/react": "^17.0.52",
在global.d.ts中增加如下代码,可以重新声明 React.forwardRef 函数,但是同时react的其他属性就没有了
declare module 'react' {
function forwardRef<T, P = {}>(
render: (props: P, ref: React.Ref<T>) => React.ReactElement | null
): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
}
,如何在保留react其他属性的前提下,只重新声明其中一个属性。