You don't need to add a generic parameter any
for props if you are not using it in the function definition/component.
const Child = forwardRef<HTMLInputElement>((props, ref) => {
return <Input ref={ref} />;
});
A short note on forwardRef. It is a generic function that has type parameters of ref and props types.
const comp = React.forwardRef<RefType, PropsType>((props, ref) => {
return someComp;
});
You will be confused about the ordering of the generic parameter (ref and then props) which is the opposite of the ordering of the function parameters (props and then ref).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…