Type(Upload): RcCustomRequestOptions in Upload component no longer exported
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Steps to reproduce
Use the Dragger
component from Upload
(with Typescript) and pass a custom function to the customRequest
prop (as in don’t pass an inline arrow function). If you want to use RcCustomRequestOptions
which the prop requires it is no longer being exported. Exact error is /antd/lib/upload/interface"' declares 'RcCustomRequestOptions' locally, but it is not exported.
What is expected?
I’d expect to still have access to the interface needed to satisfy the prop
What is actually happening?
The interface is no longer exported from antd
Environment | Info |
---|---|
antd | 4.10.0 |
React | 17.0.1 |
System | Mac osx 11.0.1 |
Browser | Chrome 87.0.4280.88 |
I don’t know if this was intentional or not and I can’t find the commit that changed this but I don’t believe it should be enforced to use an inline arrow function to satisfy typescript in this scenario. I see the change was that the interface is being pulled from the actual rc-upload
library instead of being manually defined in antd, but would prefer not to have install that just to have access to this 1 interface
Issue Analytics
- State:
- Created 3 years ago
- Reactions:12
- Comments:11 (2 by maintainers)
Could you please export something like this so developers can use when using
Upload
in typescript?RcCustomRequestOptions
is internal type define that we do not want to open to the public. We may not maintain the interface withRC
prefix since it’s all from therc-component
that we only rename not to conflict with internal define.This may not fix since it may leave too many legacy interface define in interface file.
Sorry about that.