mirror of
https://github.com/bartgryszko/react-native-circular-progress.git
synced 2026-01-18 16:13:10 +00:00
Using ViewPropTypes.style to fix a production crash issue.
This commit is contained in:
parent
91f15f5a53
commit
85eb3c4d78
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { View, Animated } from 'react-native';
|
||||
import { View, ViewPropTypes, Animated } from 'react-native';
|
||||
import CircularProgress from './CircularProgress';
|
||||
const AnimatedProgress = Animated.createAnimatedComponent(CircularProgress);
|
||||
|
||||
@ -56,7 +56,7 @@ export default class AnimatedCircularProgress extends React.Component {
|
||||
}
|
||||
|
||||
AnimatedCircularProgress.propTypes = {
|
||||
style: View.propTypes.style,
|
||||
style: ViewPropTypes.style,
|
||||
size: PropTypes.number.isRequired,
|
||||
fill: PropTypes.number,
|
||||
prefill: PropTypes.number,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { View, Platform } from 'react-native';
|
||||
import { View, ViewPropTypes, Platform } from 'react-native';
|
||||
import { Surface, Shape, Path, Group } from '../../react-native/Libraries/ART/ReactNativeART';
|
||||
import MetricsPath from 'art/metrics/path';
|
||||
|
||||
@ -28,7 +28,7 @@ export default class CircularProgress extends React.Component {
|
||||
const { size, width, tintColor, backgroundColor, style, rotation, linecap, children } = this.props;
|
||||
const backgroundPath = this.circlePath(size / 2, size / 2, size / 2 - width / 2, 0, 360 * .9999);
|
||||
|
||||
const fill = this.extractFill(this.props.fill);
|
||||
const fill = this.extractFill(this.props.fill);
|
||||
const circlePath = this.circlePath(size / 2, size / 2, size / 2 - width / 2, 0, (360 * .9999) * fill / 100);
|
||||
|
||||
return (
|
||||
@ -55,7 +55,7 @@ export default class CircularProgress extends React.Component {
|
||||
}
|
||||
|
||||
CircularProgress.propTypes = {
|
||||
style: View.propTypes.style,
|
||||
style: ViewPropTypes.style,
|
||||
size: PropTypes.number.isRequired,
|
||||
fill: PropTypes.number.isRequired,
|
||||
width: PropTypes.number.isRequired,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user