fisshy / react-scroll

React scroll component
https://github.com/fisshy/react-scroll/blob/master/README.md
MIT License
4.36k stars 437 forks source link

How to handle event before delay? #418

Open YuK1Game opened 4 years ago

YuK1Game commented 4 years ago

Hi.

I want to do a scroll action with a delay. and want execute an event just before the delay.

However, register('begin') is executed after delay.

Is there a way?

thanks.

fisshy commented 4 years ago

Hi

Have you tried adding an event to the Link/Trigger of the scroll?

i.e onClick={e => { /execute event / scroller.scrollTo("id", { delay : 200 }) }}