Skip to content

Commit

Permalink
Fix state initialization in Scroller.js (#204).
Browse files Browse the repository at this point in the history
numVisibleItems needs initial value in case onLayout doesn't fire first.
  • Loading branch information
peacechen committed Jun 26, 2020
1 parent f1015d8 commit ee3fa18
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Scroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default class CalendarScroller extends Component {
this.state = {
...this.updateLayout(props.renderDayParams),
...this.updateDaysData(props.data),
numVisibleItems: 1, // updated in onLayout
};
}

Expand Down

0 comments on commit ee3fa18

Please sign in to comment.