Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke 'clear' method #93

Closed
xuan9230 opened this issue Oct 11, 2016 · 3 comments
Closed

Invoke 'clear' method #93

xuan9230 opened this issue Oct 11, 2016 · 3 comments
Labels

Comments

@xuan9230
Copy link

xuan9230 commented Oct 11, 2016

Hi, thanks for the awesome component.

I noticed there's a method called clear in the ReactS3Uploader.js, but not exposed. Say I want to clear the input value to be null every time after uploading, how can I use that?

Many thanks!

@xuan9230
Copy link
Author

xuan9230 commented Oct 11, 2016

Just figured out myself. We can do

<ReactS3Uploader ref={node => (this.node = node)} />

And in onFinish: this.node.clear();

This will clear out the input element. Not sure if this is a good practice, and is there a way of getting the input 'value' directly?

@seanadkinson
Copy link
Contributor

That would be the correct way to call clear, yes.

You may be able to get the value from one of the event listeners, but perhaps exposing it would be good. Take a stab at a PR if you like.

Thanks!

@iamshouvikmitra
Copy link

Hi @seanadkinson,
How do I use the same in a functional component?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants