From f9e89e79721f19b8ce0a33fe070e7fd21444137e Mon Sep 17 00:00:00 2001 From: Abhinandan Kushwaha Date: Tue, 19 Oct 2021 19:13:50 +0530 Subject: [PATCH] removed delay from Pie charts --- package.json | 2 +- src/PieChart/index.tsx | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index bce9d51..7040c83 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-gifted-charts", - "version": "0.1.10", + "version": "0.1.11", "description": "The most complete library for Bar, Line, Area, Pie and Donut charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.", "main": "src/index.tsx", "files": [ diff --git a/src/PieChart/index.tsx b/src/PieChart/index.tsx index 7f09c81..452fab1 100644 --- a/src/PieChart/index.tsx +++ b/src/PieChart/index.tsx @@ -1,4 +1,4 @@ -import React, {useEffect, useState} from 'react'; +import React from 'react'; import {ColorValue, View} from 'react-native'; import Canvas from 'react-native-canvas'; @@ -83,12 +83,6 @@ export const PieChart = (props: propTypes) => { const canvasHeight = isThreeD ? radius * 2.5 + 60 : radius * 2 + 60; const canvasWidth = radius * 2 + 60; - const [visibility, setVisibility] = useState(false); - - useEffect(() => { - setTimeout(() => setVisibility(true), 410); - }, []); - const handleCanvas = async (canvas: Canvas) => { if (!canvas) { return null; @@ -285,7 +279,7 @@ export const PieChart = (props: propTypes) => { return ( - {visibility && (props.centerLabelComponent || (donut && !isDataShifted)) && ( + {(props.centerLabelComponent || (donut && !isDataShifted)) && (