Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Using this.setTimeout and console.log elimination
As documented in
https://facebook.github.io/react-native/docs/timers.html, using
this.setTimeout
  • Loading branch information
Gianmarco Leone committed Jan 25, 2017
commit 5c4ace061c99ccf6d197080f230b73f5913268cf
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ const ScrollableTabView = React.createClass({
},

componentDidMount() {
setTimeout(() => {
this.setTimeout(() => {
if (this.scrollView && Platform.OS === 'android') {
console.log("Scrolling to " + this.props.initialPage + " with containerWidth " + this.state.containerWidth);
const x = this.props.initialPage * this.state.containerWidth;
this.scrollView.scrollTo({ x, animated: false });
}
Expand Down