当前位置:网站首页>类型“FC<Props>”的参数不能赋给类型“ForwardRefRenderFunction<unknown, Props>”的参数。 属性“defaultProps”的类型不兼容。 不
类型“FC<Props>”的参数不能赋给类型“ForwardRefRenderFunction<unknown, Props>”的参数。 属性“defaultProps”的类型不兼容。 不
2022-08-01 23:41:00 【一麻袋小猫】
场景:react+ts 父子组件皆为无状态函数式组件,子组件使用了React.forward
报错:类型“FC”的参数不能赋给类型“ForwardRefRenderFunction<unknown, Props>”的参数。
属性“defaultProps”的类型不兼容。
不能将类型“Partial | undefined”分配给类型“undefined”。
不能将类型“Partial”分配给类型“undefined”
原因:报错写的很清晰了,FC与React.Forward不能同时使用
解决:这时就用普通函数组件定义方式
const MenuEditView = (props: Props, ref: any):any => {
}
export default Reacr.Forward(MenuEditView )
就一切正常了嘿
边栏推荐
- 技术分享 | 接口测试中如何使用Json 来进行数据交互 ?
- 计算由两点定义的线的角度
- Special characters & escapes in bat
- 20220725资料更新
- 2022第六届强网杯部分wp
- sys_kill system call
- Calculate the distance between two points
- Leetcode 129求根节点到叶节点数字之和、104二叉树的最大深度、8字符串转换整数(atoi)、82删除排序链表中的重复元素II、204二分查找、94二叉树的中序遍历、144二叉树的前序遍历
- CAKE:一个用于多视图知识图谱补全的可扩展性常识感知框架
- TCP 可靠吗?为什么?
猜你喜欢

Access the selected node in the console

GIF制作-灰常简单的一键动图工具

Quartus 使用 tcl 文件快速配置管脚

drf生成序列化类代码

技术分享 | 接口测试中如何使用Json 来进行数据交互 ?

Making a Simple 3D Renderer

程序员如何优雅地解决线上问题?

还在纠结报表工具的选型么?来看看这个

测试岗月薪5-9k,如何实现涨薪到25k?

With a monthly salary of 12K, the butterfly changed to a new one and moved forward bravely - she doubled her monthly salary through the career change test~
随机推荐
Sql之各种Join
Quartus 使用 tcl 文件快速配置管脚
数据机构---第五章树与二叉树---二叉树的概念---应用题
sys_kill系统调用
递归:方法调用自身
伸展树的特性及实现
部门项目源码分享
PostgreSQL 基础--常用命令
C语言——分支语句和循环语句
Spark Sql之union
Calculate the midpoint between two points
分享10套开源免费的高品质源码,免费源码下载平台
Loading configuration of Nacos configuration center
简单3D渲染器的制作
经典文献阅读之--DLO
The monthly salary of the test post is 5-9k, how to increase the salary to 25k?
还在纠结报表工具的选型么?来看看这个
技术分享 | 接口测试中如何使用Json 来进行数据交互 ?
计算两点之间的距离
color transparency parameter