diff --git a/.changeset/lucky-penguins-know.md b/.changeset/lucky-penguins-know.md new file mode 100644 index 00000000..386f4979 --- /dev/null +++ b/.changeset/lucky-penguins-know.md @@ -0,0 +1,6 @@ +--- +"example": patch +"victory-native": patch +--- + +remove temporary polar chart hack by bumping skia dep diff --git a/example/package.json b/example/package.json index 45b8f7a6..6f879d13 100644 --- a/example/package.json +++ b/example/package.json @@ -14,7 +14,7 @@ "@gorhom/bottom-sheet": "^4", "@react-native-community/slider": "4.5.6", "@react-native-segmented-control/segmented-control": "2.5.7", - "@shopify/react-native-skia": "2.0.1", + "@shopify/react-native-skia": "2.0.2", "canvaskit-wasm": "^0.40.0", "d3-scale": "^4.0.2", "date-fns": "^2.30.0", diff --git a/lib/src/polar/PolarChart.tsx b/lib/src/polar/PolarChart.tsx index a0ca0644..e9327c01 100644 --- a/lib/src/polar/PolarChart.tsx +++ b/lib/src/polar/PolarChart.tsx @@ -110,23 +110,6 @@ export const PolarChart = < const [hasMeasuredLayoutSize, setHasMeasuredLayoutSize] = React.useState(false); - const [_, setIsCanvasReady] = React.useState(false); - - // This is a hack to ensure the canvas is ready before the chart is rendered. It seems like it started somewhere with skia 2.0.0+ or RN 79+. This could periodically be removed and see if works without it. - - React.useEffect(() => { - let timerId: NodeJS.Timeout | null = null; - if (hasMeasuredLayoutSize) { - timerId = setTimeout(() => { - setIsCanvasReady(true); - }, 100); - } - return () => { - if (timerId !== null) { - clearTimeout(timerId); - } - }; - }, [hasMeasuredLayoutSize]); const onLayout = React.useCallback( ({ nativeEvent: { layout } }: LayoutChangeEvent) => { diff --git a/yarn.lock b/yarn.lock index 6714ff17..9c0440a7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2322,10 +2322,10 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.17.1.tgz#e672de70ce490e5564fe75171373d1653b5694da" integrity sha512-0QbCkfk6cnnVKWqqlC0cUrrUMDMfu5ffvYMTUHf+qMN2uAb3MKP31LPcwiMXBNsvoFGs/kYdFOsuLmvppCopXA== -"@shopify/react-native-skia@2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@shopify/react-native-skia/-/react-native-skia-2.0.1.tgz#cb52d92a70526bbb6f67158399fc704f762a485f" - integrity sha512-69Qs/cUsj43RLbl+j3orpHWwkZON5sc7aEzGfPurfz7UAzaDWnbSKEIJvUb7G+95qiJwSs94XJPapCKZoji20Q== +"@shopify/react-native-skia@2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@shopify/react-native-skia/-/react-native-skia-2.0.2.tgz#45180cc37b04325165ba995c23a7fae2c2b911a1" + integrity sha512-1/mdPHT/EUcJEdj+HkRqv+Hu40IvYXlyxn5F8G18ix6Ab27Gj58himYU7g6kXKRgSUZ9g5w63ouPcXQITHHXOw== dependencies: canvaskit-wasm "0.40.0" react-reconciler "0.31.0"