I added a download plugin, how to run my custom function when I click the download button? #111
-
Hi, I want to run a custom function when I click the download button, and then download it after some code in this function, for example, I need to save client ip, time, photoName and so on to my database. but I do not know how to achieve this function , althought I read the documents many times. Thank you.
|
Beta Was this translation helpful? Give feedback.
Answered by
igordanchenko
Apr 24, 2023
Replies: 2 comments 11 replies
-
I've added <Lightbox
on={{
download: ({ index }) => {
console.log("Download", index);
},
}}
// ...
/> |
Beta Was this translation helpful? Give feedback.
10 replies
-
Yes, I can see it on npm website .
获取 Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
发件人: Igor Danchenko ***@***.***>
发送时间: Tuesday, April 25, 2023 8:51:15 PM
收件人: igordanchenko/yet-another-react-lightbox ***@***.***>
抄送: tolyle ***@***.***>; Author ***@***.***>
主题: Re: [igordanchenko/yet-another-react-lightbox] I added a download plugin, how to run my custom function when I click the download button? (Discussion #111)
Can you see the latest version on npm website?
https://www.npmjs.com/package/yet-another-react-lightbox
[Screenshot 2023-04-25 at 8 43 53 AM]<https://user-images.githubusercontent.com/64441155/234280274-36ec8f80-a47c-4004-a2ed-4dfc5efd09f6.png>
―
Reply to this email directly, view it on GitHub<#111 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A6JPZ5HLSI55P6GMQPW5OFTXC7CEHANCNFSM6AAAAAAXJFFZG4>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If that's the case, and you do not want to use the Download plugin functionality, then you should probably implement your own Download button.
https://codesandbox.io/s/yet-another-react-lightbox-111-mbum69?file=/src/App.js
I'll add these callbacks in the next release.