question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 3 years ago
  • Reactions:12
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
duskmoon314commented, Jun 24, 2021

Could you please export something like this so developers can use when using Upload in typescript?

3reactions
zombieJcommented, Mar 29, 2021

RcCustomRequestOptions is internal type define that we do not want to open to the public. We may not maintain the interface with RC prefix since it’s all from the rc-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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Type(Upload): RcCustomRequestOptions in ... - Issuehunt
Type(Upload): RcCustomRequestOptions in Upload component no longer exported #28713 ... which the prop requires it is no longer being exported.
Read more >
Using customRequest in Ant design file upload - Stack Overflow
So event.loaded & event.total are always the same. Because of this we see the progress bar moves 100% in no time. – TA3....
Read more >
Upload - Ant Design
Uploading is the process of publishing information (web pages, text, pictures, video, etc.) to a remote server via a web page or upload...
Read more >
Understanding Package Visibility in Go - DigitalOcean
In this package, there are two exported functions: Debug and Log . ... However, the debug variable in the logging package is not...
Read more >
Building a file upload component with react-uploady and Ant ...
send }); return uploader; }; export default Uploader;. In the code above we import the Uploady component which is the context provider from ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found