slorber / react-native-scroll-into-view

Scroll a ReactNative View into the visible screen. Similar to DOMElement.scrollIntoView() browser function.
https://thisweekinreact.com
MIT License
417 stars 13 forks source link

Fix TypeError: undefined is not a function in RN 0.65.1 #38

Closed frw closed 3 years ago

frw commented 3 years ago

scrollResponderScrollTo no longer exists on ScrollResponder in RN 0.65.1, leading to a TypeError: undefined is not a function when calling scrollIntoView. This commit fixes this issue by calling scrollView.scrollTo instead when scrollResponderScrollTo does not exist.

slorber commented 3 years ago

Thanks, seems to fix https://github.com/slorber/react-native-scroll-into-view/issues/41

Have you tested this on both new + old versions of RN?

jgillick commented 3 years ago

This looks pretty backwards compatible. I did a quick test on RN 0.64 and it seemed to work as expected.

mantegnous commented 3 years ago

@slorber merge fix

frw commented 3 years ago

Hey @slorber,

I've tested this on 0.64, 0.65 and 0.66 and it works on all 3 versions.

mantegnous commented 3 years ago

@slorber so?

slorber commented 3 years ago

released in 2.0.2