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

Adding new files via context.upload(file) doesn't always trigger uploading #105

Closed
teejteej opened this issue Nov 28, 2020 · 3 comments
Closed
Labels
repro needed reproduction env is needed

Comments

@teejteej
Copy link

When calling context.upload(file), it randomly seems to not trigger the upload process. autoUpload is set to true.

Trying to force a uploadyContext.processPending() doesn't do anything either.

UPLOADER_EVENTS.BATCH_ADD is successfully called with the correct file though.
Uploadhandler's useRequestPreSend is not called.

Following code is used:
<Uploady> <UploadHandler /> <UploadButton className="btn btn-primary"> Upload Files </UploadButton> </Uploady>

Any ideas where I could look?

@yoavniran
Copy link
Collaborator

Its hard to say whats going wrong here. Definitely strange.
Please share a repro sandbox/codepen/etc

@yoavniran yoavniran added the repro needed reproduction env is needed label Nov 28, 2020
@teejteej
Copy link
Author

I've moved <Uploady ...> lower into component hierarchy, and now the issue is resolved.
I'm not sure anymore how to reliably produce an example, so I guess the issue can be closed.

@yoavniran
Copy link
Collaborator

thanks. interesting issue. if it comes back definitely let me know.
I suspect it may have something to do with re-renders. Uploady should typically be placed very high if not at the top of the tree to avoid needless re-renders. Of course, ensuring memoized props is also important.

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

No branches or pull requests

2 participants