@momo-kits/carousel 0.0.56-alpha.2 → 0.0.56-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CarouselV2.js +5 -3
  2. package/package.json +2 -3
package/CarouselV2.js CHANGED
@@ -1141,10 +1141,12 @@ export default class Carousel extends React.PureComponent {
1141
1141
  : this.props.sliderWidth / this.props.itemWidth,
1142
1142
  ) + 1;
1143
1143
  const initialNumPerSide = this._enableLoop() ? loopClonesPerSide : 2;
1144
- const initialNumToRender = visibleItems + initialNumPerSide * 2;
1145
- const maxToRenderPerBatch = initialNumToRender + initialNumPerSide * 2;
1144
+ const initialNumToRender =
1145
+ visibleItems > 2
1146
+ ? visibleItems + initialNumPerSide * 2
1147
+ : initialNumPerSide * 2;
1148
+ const maxToRenderPerBatch = initialNumToRender;
1146
1149
  const windowSize = maxToRenderPerBatch;
1147
-
1148
1150
  const specificProps = !this._needsScrollView()
1149
1151
  ? {
1150
1152
  initialNumToRender,
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "@momo-kits/carousel",
3
- "version": "0.0.56-alpha.2",
3
+ "version": "0.0.56-alpha.4",
4
4
  "private": false,
5
5
  "main": "index.js",
6
6
  "dependencies": {
7
7
  "prop-types": "^15.7.2",
8
- "react": "16.9.0",
9
- "@momo-platform/versions": "4.0.2"
8
+ "react": "16.9.0"
10
9
  },
11
10
  "peerDependencies": {
12
11
  "react": "16.9.0",