react-native-keyboard-aware-scroll-view: responder.scrollResponderScrollTo is not a function
Today i have upgraded to RN 0.65.1 and got this error.
TypeError: responder.scrollResponderScrollTo is not a function. (In 'responder.scrollResponderScrollTo({
x: x,
y: y,
animated: animated
})', 'responder.scrollResponderScrollTo' is undefined)
Lib version: "react-native-keyboard-aware-scroll-view": "^0.9.4",
The error pointed to this line: https://github.com/APSL/react-native-keyboard-aware-scroll-view/blob/master/lib/KeyboardAwareHOC.js#L276
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 19 (1 by maintainers)
On RN 66.3 I added the following dependency in the
package.json
of my project and it worked:Note: I am using
native-base
.I have forked the repo to fix this issue.
Issue is persistent in RN68
try this one:
"react-native-keyboard-aware-scroll-view": "github:APSL/react-native-keyboard-aware-scroll-view#pull/501/head",
Issue resolved with latest version
react-native-keyboard-aware-scroll-view: 0.9.5
overrides
worked for me on RN 71, put it in package.json I was usingnative-base
, maybe it won’t work for one’s who is using keyboard aware package directlyremoved
node_modules
and re-installed packages usingnpm install
, and crash went awayPR fix: https://github.com/APSL/react-native-keyboard-aware-scroll-view/pull/501
Update the following code in the /node_modules/@codler/react-native-keyboard-aware-scroll-view/lib/KeyboardAwareHOC.js file line number 244.
`scrollToPosition = (x: number, y: number, animated: boolean = true) => { const responder = this.getScrollResponder() if (!responder) { return } if (responder.scrollResponderScrollTo) { // React Native < 0.65 responder.scrollResponderScrollTo({ x, y, animated }) } else if (responder.scrollTo) { // React Native >= 0.65 responder.scrollTo({ x, y, animated }) } // responder && responder.scrollResponderScrollTo({ x, y, animated }) }
scrollToEnd = (animated?: boolean = true) => { const responder = this.getScrollResponder() if (!responder) { return } if (responder.scrollResponderScrollTo) { // React Native < 0.65 responder.scrollResponderScrollTo({ x, y, animated }) } else if (responder.scrollTo) { // React Native >= 0.65 responder.scrollTo({ x, y, animated }) } // responder && responder.scrollResponderScrollToEnd({ animated }) }`
Above Worked for me! I was use older version of native-base “^2.15.2” with latest react native version “0.72.6”. I don’t where that codler came from but this solved my issue.
@Seunope @alishah514 This issue occurs only if we are using native base?
@alishah514 solution worked. I arranged the text for proper visualization. I am using native-base: 2.13.15, react-native: 0.72.6
Facing issue with RN 68 and native base.