Skip to content

Commit

Permalink
Merge pull request #6 from falsecz/ViewPropTypes
Browse files Browse the repository at this point in the history
View.propTypes is deprecated, switch to ViewPropTypess
  • Loading branch information
pinguinjkeke authored Nov 12, 2017
2 parents d6ee8d4 + ae898a0 commit 459cef7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/WheelCurvedPicker.android.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import React, { PureComponent } from 'react';
import { ColorPropType, requireNativeComponent, View } from 'react-native';
import { ColorPropType, requireNativeComponent, View, ViewPropTypes as RNViewPropTypes } from 'react-native';
import PropTypes from 'prop-types';

const ViewPropTypes = RNViewPropTypes || View.propTypes;

const stateFromProps = (props) => {
let selectedIndex = 0;

Expand All @@ -18,7 +20,7 @@ const stateFromProps = (props) => {

class WheelCurvedPicker extends PureComponent {
static propTypes = {
...View.propTypes,
...ViewPropTypes,
data: PropTypes.array,
textColor: ColorPropType,
textSize: PropTypes.number,
Expand Down
8 changes: 5 additions & 3 deletions src/picker.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React, { Component } from 'react';
import { ColorPropType, StyleSheet, View, Text } from 'react-native';
import { ColorPropType, StyleSheet, View, ViewPropTypes as RNViewPropTypes, Text } from 'react-native';
import PropTypes from 'prop-types';
import WheelCurvedPicker from './WheelCurvedPicker';

const ViewPropTypes = RNViewPropTypes || View.propTypes;

const PickerItem = WheelCurvedPicker.Item;

const styles = StyleSheet.create({
Expand All @@ -18,10 +20,10 @@ export default class Picker extends Component {
textColor: ColorPropType,
textSize: PropTypes.number,
itemSpace: PropTypes.number,
itemStyle: View.propTypes.style,
itemStyle: ViewPropTypes.style,
onValueChange: PropTypes.func.isRequired,
pickerData: PropTypes.array.isRequired,
style: View.propTypes.style,
style: ViewPropTypes.style,
selectedValue: PropTypes.any,
};

Expand Down

0 comments on commit 459cef7

Please sign in to comment.