参考 antd 中关于 form 部分的源代码
const Form = React.forwardRef<FormInstance, FormProps>(InternalForm) as <Values = any>(
props: React.PropsWithChildren<FormProps<Values>> & { ref?: React.Ref<FormInstance<Values>> },
) => React.ReactElement;
这么写就ok了
const ref = React.createRef<FormInstance>();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…