Skip to content

Commit

Permalink
Fix prop-types
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuxiang committed Oct 6, 2017
1 parent 9da9785 commit 047fa54
Show file tree
Hide file tree
Showing 12 changed files with 457 additions and 634 deletions.
2 changes: 1 addition & 1 deletion components/PropTypes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {PropTypes} from 'react'
import PropTypes from 'prop-types'

const LatLng = PropTypes.shape({
latitude: PropTypes.number.isRequired,
Expand Down
3 changes: 2 additions & 1 deletion components/maps/Circle.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {PropTypes, PureComponent} from 'react'
import React, {PureComponent} from 'react'
import PropTypes from 'prop-types'
import {PixelRatio, Platform, requireNativeComponent, ViewPropTypes} from 'react-native'
import {LatLng} from '../PropTypes'

Expand Down
3 changes: 2 additions & 1 deletion components/maps/HeatMap.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {PropTypes, PureComponent} from 'react'
import React, {PureComponent} from 'react'
import PropTypes from 'prop-types'
import {PixelRatio, Platform, requireNativeComponent, ViewPropTypes} from 'react-native'
import {LatLng} from '../PropTypes'

Expand Down
17 changes: 9 additions & 8 deletions components/maps/MapView.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @flow
import React, {PropTypes} from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import {requireNativeComponent, ViewPropTypes} from 'react-native'
import {LatLng, Region} from '../PropTypes'
import BaseComponent from '../BaseComponent'
Expand Down Expand Up @@ -159,37 +160,37 @@ export default class MapView extends BaseComponent {
/**
* 点击事件
*/
onPress: React.PropTypes.func,
onPress: PropTypes.func,

/**
* 长按事件
*/
onLongPress: React.PropTypes.func,
onLongPress: PropTypes.func,

/**
* 定位事件
*/
onLocation: React.PropTypes.func,
onLocation: PropTypes.func,

/**
* 动画完成事件
*/
onAnimateFinish: React.PropTypes.func,
onAnimateFinish: PropTypes.func,

/**
* 动画取消事件
*/
onAnimateCancel: React.PropTypes.func,
onAnimateCancel: PropTypes.func,

/**
* 地图状态变化事件
*/
onStatusChange: React.PropTypes.func,
onStatusChange: PropTypes.func,

/**
* 地图状态变化完成事件
*/
onStatusChangeComplete: React.PropTypes.func,
onStatusChangeComplete: PropTypes.func,
}

/**
Expand Down
13 changes: 7 additions & 6 deletions components/maps/Marker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {PropTypes} from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import {Platform, requireNativeComponent, StyleSheet, ViewPropTypes, View} from 'react-native'
import InfoWindow from './InfoWindow'
import {LatLng, Point} from '../PropTypes'
Expand Down Expand Up @@ -110,29 +111,29 @@ export default class Marker extends BaseComponent {
/**
* 点击事件
*/
onPress: React.PropTypes.func,
onPress: PropTypes.func,

/**
* 拖放开始事件
*/
onDragStart: React.PropTypes.func,
onDragStart: PropTypes.func,

/**
* 拖放进行事件,类似于 mousemove,在结束之前会不断调用
*/
onDrag: React.PropTypes.func,
onDrag: PropTypes.func,

/**
* 拖放结束事件,最终坐标将传入参数
*/
onDragEnd: React.PropTypes.func,
onDragEnd: PropTypes.func,

/**
* 信息窗体点击事件
*
* 注意,对于自定义信息窗体,该事件是无效的
*/
onInfoWindowPress: React.PropTypes.func,
onInfoWindowPress: PropTypes.func,
}

_renderInfoWindow(view) {
Expand Down
5 changes: 3 additions & 2 deletions components/maps/MultiPoint.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {PropTypes, PureComponent} from 'react'
import React, {PureComponent} from 'react'
import PropTypes from 'prop-types'
import {requireNativeComponent, resolveAssetSource, ViewPropTypes} from 'react-native'

export default class MultiPoint extends PureComponent {
Expand All @@ -25,7 +26,7 @@ export default class MultiPoint extends PureComponent {
/**
* 点击事件
*/
onItemPress: React.PropTypes.func,
onItemPress: PropTypes.func,
}

_onItemPress = event => {
Expand Down
3 changes: 2 additions & 1 deletion components/maps/Polygon.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {PropTypes, PureComponent} from 'react'
import React, {PureComponent} from 'react'
import PropTypes from 'prop-types'
import {PixelRatio, Platform, requireNativeComponent, ViewPropTypes} from 'react-native'
import {LatLng} from '../PropTypes'

Expand Down
3 changes: 2 additions & 1 deletion components/maps/Polyline.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {PropTypes, PureComponent} from 'react'
import React, {PureComponent} from 'react'
import PropTypes from 'prop-types'
import {PixelRatio, Platform, processColor, requireNativeComponent, ViewPropTypes} from 'react-native'
import {LatLng} from '../PropTypes'

Expand Down
3 changes: 2 additions & 1 deletion components/navigation/Base.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @flow
import React, {PropTypes} from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import {ViewPropTypes} from 'react-native'
import BaseComponent from '../BaseComponent'

Expand Down
Loading

0 comments on commit 047fa54

Please sign in to comment.