daybrush / infinite-viewer

Infinite Viewer is Document Viewer Component with infinite scrolling.
https://daybrush.com/infinite-viewer/
MIT License
283 stars 30 forks source link

infiniteViewerRef.current.on is not a function #55

Open enk0de opened 1 year ago

enk0de commented 1 year ago

In react, when i pass ref to InfiniteViewer component, and i refer infiniteViewerRef.current.on, the error infiniteViewerRef.current.on is not a function is not a function is shown.

daybrush commented 1 year ago

@hoondeveloper

Is there any reason to use on?

Try using react's on prefix prop.

onDragStart, onPinch, onScroll, ...

enk0de commented 1 year ago

I was going to take the responsibility of handling the infinite viewer's events away from the manager that is declared as class that manages the infinite viewer, but on second thought, that's not necessary. Thanks for the answer.