当前位置:网站首页>类型“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 )
就一切正常了嘿
边栏推荐
- 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~
- 软件测试之移动APP安全测试简析,北京第三方软件检测机构分享
- sys_kill系统调用
- B. Difference Array--Codeforces Round #808 (Div. 1)
- Flink学习第五天——Flink可视化控制台依赖配置和界面介绍
- Secondary Vocational Network Security Competition B7 Competition Deployment Process
- [Camp Experience Post] 2022 Cybersecurity Summer Camp
- FAST-LIO2 code analysis (2)
- Quartus uses tcl files to quickly configure pins
- The third chapter of the imitation cattle network project: develop the core functions of the community (detailed steps and ideas)
猜你喜欢

Deep Learning Fundamentals - Numpy-based Recurrent Neural Network (RNN) implementation and backpropagation training

数据机构---第五章树与二叉树---二叉树的概念---应用题

Building a cloud-native DevOps environment

ICLR 2022最佳论文:基于对比消歧的偏标签学习

访问控制台中的选定节点

C language - branch statement and loop statement

Work for 5 years, test case design is bad?To look at the big case design summary

Leetcode 129求根节点到叶节点数字之和、104二叉树的最大深度、8字符串转换整数(atoi)、82删除排序链表中的重复元素II、204二分查找、94二叉树的中序遍历、144二叉树的前序遍历

cdh6打开oozieWeb页面,Oozie web console is disabled.

云原生DevOps环境搭建
随机推荐
npm npm
计算由两点定义的线的角度
chrome copies the base64 data of an image
IDEA入门看这一篇就够了
伸展树的特性及实现
TCP 可靠吗?为什么?
Data Organization --- Chapter 5 Trees and Binary Trees --- The Concept of Binary Trees --- Application Questions
CAKE:一个用于多视图知识图谱补全的可扩展性常识感知框架
Classical Literature Reading--DLO
CF1705D Mark and Lightbulbs
基于JAX的激活函数、softmax函数和交叉熵函数
月薪12K,蝶变向新,勇往直前—她通过转行测试实现月薪翻倍~
【参营经历贴】2022网安夏令营
prim生成树
The monthly salary of the test post is 5-9k, how to increase the salary to 25k?
Oracle 数据库设置为只读及读写
Avoid hidden text when loading fonts
切面打印调取的方法
Chapter 12 End-User Task As Shell Scripts
解决端口占用