Skip to content

Commit 4043494

Browse files
committed
Remove fancy style prop types
1 parent 92acfc4 commit 4043494

5 files changed

Lines changed: 10 additions & 24 deletions

File tree

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
],
1111
"parser": "babel-eslint",
1212
"rules": {
13+
"react/forbid-prop-types": [0],
1314
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
1415
"import/no-extraneous-dependencies": [0],
1516
"import/no-unresolved": [2, { ignore: ['^react(-native)?$'] }],

Bar.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import React, { Component } from 'react';
22
import PropTypes from 'prop-types';
3-
import { Animated, Easing, View, ViewPropTypes } from 'react-native';
3+
import { Animated, Easing, View } from 'react-native';
44

55
const INDETERMINATE_WIDTH_FACTOR = 0.3;
66
const BAR_WIDTH_ZERO_POSITION =
77
INDETERMINATE_WIDTH_FACTOR / (1 + INDETERMINATE_WIDTH_FACTOR);
88

9-
const RNViewPropTypes = ViewPropTypes || View.propTypes;
10-
119
export default class ProgressBar extends Component {
1210
static propTypes = {
1311
animated: PropTypes.bool,
@@ -20,7 +18,7 @@ export default class ProgressBar extends Component {
2018
indeterminate: PropTypes.bool,
2119
onLayout: PropTypes.func,
2220
progress: PropTypes.number,
23-
style: RNViewPropTypes.style,
21+
style: PropTypes.any,
2422
unfilledColor: PropTypes.string,
2523
width: PropTypes.number,
2624
useNativeDriver: PropTypes.bool,

Circle.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
import React, { Component } from 'react';
22
import PropTypes from 'prop-types';
3-
import {
4-
Animated,
5-
ART,
6-
StyleSheet,
7-
Text,
8-
View,
9-
ViewPropTypes,
10-
} from 'react-native';
3+
import { Animated, ART, StyleSheet, Text, View } from 'react-native';
114

125
import Arc from './Shapes/Arc';
136
import withAnimation from './withAnimation';
@@ -17,8 +10,6 @@ const CIRCLE = Math.PI * 2;
1710
const AnimatedSurface = Animated.createAnimatedComponent(ART.Surface);
1811
const AnimatedArc = Animated.createAnimatedComponent(Arc);
1912

20-
const RNViewPropTypes = ViewPropTypes || View.propTypes;
21-
2213
const styles = StyleSheet.create({
2314
container: {
2415
backgroundColor: 'transparent',
@@ -43,9 +34,9 @@ export class ProgressCircle extends Component {
4334
rotation: PropTypes.instanceOf(Animated.Value),
4435
showsText: PropTypes.bool,
4536
size: PropTypes.number,
46-
style: RNViewPropTypes.style,
37+
style: PropTypes.any,
4738
strokeCap: PropTypes.oneOf(['butt', 'square', 'round']),
48-
textStyle: Text.propTypes.style,
39+
textStyle: PropTypes.any,
4940
thickness: PropTypes.number,
5041
unfilledColor: PropTypes.string,
5142
endAngle: PropTypes.number,

CircleSnail.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from 'react';
22
import PropTypes from 'prop-types';
3-
import { Animated, ART, Easing, View, ViewPropTypes } from 'react-native';
3+
import { Animated, ART, Easing } from 'react-native';
44

55
import Arc from './Shapes/Arc';
66

@@ -9,8 +9,6 @@ const AnimatedArc = Animated.createAnimatedComponent(Arc);
99
const MIN_ARC_ANGLE = 0.1;
1010
const MAX_ARC_ANGLE = 1.5 * Math.PI;
1111

12-
const RNViewPropTypes = ViewPropTypes || View.propTypes;
13-
1412
export default class CircleSnail extends Component {
1513
static propTypes = {
1614
animating: PropTypes.bool,
@@ -24,7 +22,7 @@ export default class CircleSnail extends Component {
2422
hidesWhenStopped: PropTypes.bool,
2523
size: PropTypes.number,
2624
spinDuration: PropTypes.number,
27-
style: RNViewPropTypes.style,
25+
style: PropTypes.any,
2826
thickness: PropTypes.number,
2927
strokeCap: PropTypes.string,
3028
};

Pie.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from 'react';
22
import PropTypes from 'prop-types';
3-
import { Animated, ART, StyleSheet, View, ViewPropTypes } from 'react-native';
3+
import { Animated, ART, StyleSheet, View } from 'react-native';
44

55
import Circle from './Shapes/Circle';
66
import Sector from './Shapes/Sector';
@@ -11,8 +11,6 @@ const CIRCLE = Math.PI * 2;
1111
const AnimatedSurface = Animated.createAnimatedComponent(ART.Surface);
1212
const AnimatedSector = Animated.createAnimatedComponent(Sector);
1313

14-
const RNViewPropTypes = ViewPropTypes || View.propTypes;
15-
1614
const styles = StyleSheet.create({
1715
container: {
1816
backgroundColor: 'transparent',
@@ -33,7 +31,7 @@ export class ProgressPie extends Component {
3331
]),
3432
rotation: PropTypes.instanceOf(Animated.Value),
3533
size: PropTypes.number,
36-
style: RNViewPropTypes.style,
34+
style: PropTypes.any,
3735
unfilledColor: PropTypes.string,
3836
};
3937

0 commit comments

Comments
 (0)