femioladeji / react-slideshow

A react component for slideshow supporting slide, fade and zoom
https://react-slideshow-image.netlify.app/
MIT License
359 stars 71 forks source link

zoom scale prop should accept function instead of constant value #224

Open lemontini opened 8 months ago

lemontini commented 8 months ago

Hello,

First of all - quite nice and not too bloated component (in terms of codebase), nice!I have come up to an issue, where I'd like the zoom effect to be inwards when click left arrow, and to be outward - when I click right arrow. Would it be difficult for you to implement that? I think all it needs is for scale prop to accept the function with parameters <from, to> instead of a constant (as it currently is). Do you agree?

P.S. I've tried to supply a value from state to scale prop, changing that value according to <from, to> values in method onStartChange, but the problem with stateful values is that they change only on next render, so it always is 1-click late...

femioladeji commented 7 months ago

hmmnn @lemontini thanks for bringing it up. I'll take a look at it over the weekend and get back to you