Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/lucky-penguins-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"example": patch
"victory-native": patch
---

remove temporary polar chart hack by bumping skia dep
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
17 changes: 0 additions & 17 deletions lib/src/polar/PolarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down