From 113ecdf629cf90e35cec1a340109c4f88b0c724f Mon Sep 17 00:00:00 2001 From: Shubham Choudhary Date: Tue, 16 Jul 2019 21:28:47 +0530 Subject: [PATCH] fix(index): replace this.requestAnimationFrame Replace this.requestAnimationFrame with request animation frame as **requestAnimationFrame** is globally available in react native. requestAnimationFrame is a polyfill from the browser, in browser as well it is scoped to window object. See here: https://stackoverflow.com/questions/51258292/use-requestanimationframe-in-react-native --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 1ff36a69..f125bdc6 100644 --- a/lib/index.js +++ b/lib/index.js @@ -260,7 +260,7 @@ class ScrollableTabView extends Component { const {width} = e.nativeEvent.layout if (Math.round(width) !== Math.round(this.state.containerWidth)) { this.setState({containerWidth: width}) - this.requestAnimationFrame(() => { + requestAnimationFrame(() => { this.goToPage(this.state.currentPage) }) }