业务背景
最近在根据视频学react
+ antd
,还木有来得及通读文档.因项目进度问题,暂时木有时间通读文档,所以遇到超过半个小时自己无法搞定的问题,就来提个问题,麻烦各位了
遇到的困难
把Upload
放在Form
下面,初始化组件会提示一个错误
Warning: [antd: Upload] `value` is not a valid prop, do you mean `fileList`?
当我在Form.Item
加上valuePropName="fileList"
属性后,初始化组件正常,但是点击上传图片就会报一个空指针错误
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
我的问题
- 空指针异常这个怎么解决呢?
- 是什么原因导致这个问题产生的呢?
示例代码
https://codesandbox.io/s/form...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…