mirror of
https://github.com/bartgryszko/react-native-circular-progress.git
synced 2026-01-18 16:13:10 +00:00
Move to pure component
This commit is contained in:
parent
5d714a016b
commit
dfd9f6fa79
@ -3,14 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import { View, ViewPropTypes } from 'react-native';
|
||||
import { Svg, Path, G } from 'react-native-svg';
|
||||
|
||||
export default class CircularProgress extends React.Component {
|
||||
|
||||
// eliminate unecessary re-renders
|
||||
shouldComponentUpdate(nextProps, nextState, nextContext) {
|
||||
if (this.props === nextProps) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
export default class CircularProgress extends React.PureComponent {
|
||||
polarToCartesian(centerX, centerY, radius, angleInDegrees) {
|
||||
var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;
|
||||
return {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user