We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f245199 commit ada2c50Copy full SHA for ada2c50
src/hooks/useScrollTo/index.ts
@@ -74,11 +74,11 @@ const useScrollTo = <T extends ScrollToSupportedViews>(props: ScrollToProps<T>):
74
}
75
76
// @ts-ignore
77
- if (_.isFunction(scrollViewRef.current.scrollToOffset)) {
+ if (_.isFunction(scrollViewRef.current?.scrollToOffset)) {
78
79
scrollViewRef.current.scrollToOffset({offset, animated});
80
81
- } else if (_.isFunction(scrollViewRef.current.scrollTo)) {
+ } else if (_.isFunction(scrollViewRef.current?.scrollTo)) {
82
const scrollToXY = horizontal ? {x: offset} : {y: offset};
83
84
scrollViewRef.current.scrollTo({...scrollToXY, animated});
0 commit comments