AndreasFaust / react-ticker

React Ticker is a lightweight, performant React component, that moves text, images and videos infinitely like a newsticker.
https://andreasfaust.github.io/react-ticker/
288 stars 50 forks source link

callbacks onNext and onFinish dont seem to be firing. #47

Open laurencefass opened 2 years ago

laurencefass commented 2 years ago

I created a sandbox based on your own. I have added the callbacks but they dont seem to be firing,

https://codesandbox.io/s/react-ticker-no-callbacks-n7i0t

Also not really sure of the purpose of onFinish as it doesnt offer any arguments.

Thanks

mariukhin commented 2 years ago

@laurencefass because your data inside Ticker callback is infinite. There is no any final value after which onFinish and onNext callbacks will be called. For example: create an array of 10 elements and render iе inside Ticker element callback using map