@momo-kits/swipe 0.0.53-beta → 0.0.53-beta.12

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.
package/Swiper.js CHANGED
@@ -325,7 +325,7 @@ export default class Swiper extends Component {
325
325
  * Automatic rolling
326
326
  */
327
327
  autoplay = () => {
328
- if (!Array.isArray(this.props.children)
328
+ if (!Array.isArray(this?.props?.children)
329
329
  || !this.props.autoplay
330
330
  || this.internals.isScrolling
331
331
  || this.state.autoplayEnd) return;
@@ -577,15 +577,14 @@ export default class Swiper extends Component {
577
577
  }
578
578
 
579
579
  renderTitle = () => {
580
- const child = this.props.children[this.state.index];
581
- const title = child && child.props && child.props.title;
582
- return title
583
- ? (
584
- <View style={styles.title}>
585
- {this.props.children[this.state.index].props.title}
586
- </View>
587
- )
588
- : null;
580
+ let { children = [] } = this.props;
581
+ const child = children[this.state.index];
582
+ const title = child && child.props && child.props.title
583
+ return !!title ? (
584
+ <View style={styles.title}>
585
+ {this.props.children?.[this.state.index].props.title}
586
+ </View>
587
+ ) : null
589
588
  }
590
589
 
591
590
  renderNextButton = () => {
package/package.json CHANGED
@@ -1,15 +1,17 @@
1
1
  {
2
- "name": "@momo-kits/swipe",
3
- "version": "0.0.53-beta",
4
- "private": false,
5
- "main": "index.js",
6
- "dependencies": {},
7
- "peerDependencies": {
8
- "prop-types": "^15.7.2",
9
- "react": "^16.9.0",
10
- "react-native": ">=0.55",
11
- "@momo-kits/core": ">=0.0.5-beta"
12
- },
13
- "devDependencies": {},
14
- "license": "MoMo"
2
+ "name": "@momo-kits/swipe",
3
+ "version": "0.0.53-beta.12",
4
+ "private": false,
5
+ "main": "index.js",
6
+ "dependencies": {
7
+ "@momo-platform/versions": "4.0.2"
8
+ },
9
+ "peerDependencies": {
10
+ "prop-types": "^15.7.2",
11
+ "react": "^16.9.0",
12
+ "react-native": ">=0.55",
13
+ "@momo-kits/core": ">=0.0.5-beta"
14
+ },
15
+ "devDependencies": {},
16
+ "license": "MoMo"
15
17
  }
package/publish.sh CHANGED
@@ -21,9 +21,9 @@ rsync -r --verbose --exclude '*.mdx' --exclude '*Demo.js' --exclude 'props-type
21
21
  #npm login
22
22
  #publish dist to npm
23
23
  cd dist
24
- npm publish --access=public
24
+ npm publish --tag beta --access=public
25
25
  cd ..
26
26
  rm -rf dist
27
27
 
28
28
 
29
- curl -X POST -H 'Content-Type: application/json' 'https://chat.googleapis.com/v1/spaces/AAAAbP8987c/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=UGSFRvk_oYb9uGsAgs31bVvMm6jDkmD8zihGm3eyaQA%3D&threadKey=JoaXTEYaNNkl' -d '{"text": "@momo-kits/swipe new version release: '*"$VERSION"*' https://www.npmjs.com/package/@momo-kits/swipe"}'
29
+ curl -X POST -H 'Content-Type: application/json' 'https://chat.googleapis.com/v1/spaces/AAAAbP8987c/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=UGSFRvk_oYb9uGsAgs31bVvMm6jDkmD8zihGm3eyaQA%3D&threadKey=JoaXTEYaNNkl' -d '{"text": "@momo-kits/swipe new version release: '*"$VERSION"*' https://www.npmjs.com/package/@momo-kits/swipe"}'