Skip to content

Commit 02653f3

Browse files
committed
feat: rn 74 & expo 51
Signed-off-by: tony chen <tony.zq.chen@gmail.com>
1 parent ca04405 commit 02653f3

File tree

9 files changed

+3659
-3561
lines changed

9 files changed

+3659
-3561
lines changed

example/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010
},
1111
"dependencies": {
1212
"@expo/webpack-config": "~19.0.1",
13-
"@shopify/react-native-skia": "0.1.221",
13+
"@shopify/react-native-skia": "1.2.3",
1414
"echarts": "^5.5.0",
15-
"expo": "~50.0.7",
15+
"expo": "~51.0.0",
1616
"react": "18.2.0",
1717
"react-dom": "18.2.0",
18-
"react-native": "0.73.4",
19-
"react-native-gesture-handler": "~2.14.0",
20-
"react-native-svg": "14.1.0",
18+
"react-native": "0.74.1",
19+
"react-native-gesture-handler": "~2.16.1",
20+
"react-native-svg": "15.2.0-rc.0",
2121
"react-native-web": "~0.19.6",
2222
"zrender": "^5.5.0"
2323
},
2424
"devDependencies": {
25-
"@babel/core": "^7.12.9",
25+
"@babel/core": "^7.24.0",
2626
"babel-loader": "^8.2.3",
2727
"babel-plugin-module-resolver": "^4.1.0"
2828
},

example/src/App.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { StyleSheet, View, Dimensions } from 'react-native';
44
import { gestureHandlerRootHOC } from 'react-native-gesture-handler';
55
import { SVGRenderer, SkiaChart, SvgChart } from '@wuba/react-native-echarts';
66
import * as echarts from 'echarts/core';
7-
import { BarChart } from 'echarts/charts';
7+
import { BarChart, LineChart } from 'echarts/charts';
88
import {
99
TitleComponent,
1010
TooltipComponent,
@@ -19,6 +19,7 @@ echarts.use([
1919
SVGRenderer,
2020
// ...
2121
BarChart,
22+
LineChart,
2223
]);
2324

2425
const E_HEIGHT = 250;
@@ -72,11 +73,18 @@ const option = {
7273
yAxis: {
7374
type: 'value',
7475
},
76+
tooltip: {
77+
trigger: 'axis',
78+
},
7579
series: [
7680
{
7781
data: [120, 200, 150, 80, 70, 110, 130],
7882
type: 'bar',
7983
},
84+
{
85+
data: [220, 100, 180, 160, 150, 120, 110],
86+
type: 'line',
87+
},
8088
],
8189
};
8290
function App() {

example/yarn.lock

+1,831-1,970
Large diffs are not rendered by default.

package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@
5555
"devDependencies": {
5656
"@arkweid/lefthook": "^0.7.7",
5757
"@commitlint/config-conventional": "^17.0.2",
58-
"@react-native-community/eslint-config": "^3.0.2",
59-
"@react-native/babel-preset": "0.73.19",
58+
"@react-native-community/eslint-config": "^3.2.0",
59+
"@react-native/babel-preset": "0.74.81",
6060
"@release-it/conventional-changelog": "^5.0.0",
61-
"@shopify/react-native-skia": "0.1.221",
61+
"@shopify/react-native-skia": "1.2.3",
6262
"@testing-library/react-native": "^12.4.3",
6363
"@types/jest": "^29.5.11",
6464
"@types/react": "~18.2.14",
@@ -74,13 +74,13 @@
7474
"pod-install": "^0.1.0",
7575
"prettier": "^2.0.5",
7676
"react": "18.2.0",
77-
"react-native": "0.73.4",
77+
"react-native": "0.74.1",
7878
"react-native-builder-bob": "^0.20.0",
79-
"react-native-gesture-handler": "~2.14.0",
80-
"react-native-svg": "14.1.0",
79+
"react-native-gesture-handler": "~2.16.0",
80+
"react-native-svg": "15.2.0-rc.0",
8181
"react-test-renderer": "^18.2.0",
8282
"release-it": "^15.0.0",
83-
"sharp": "^0.33.2",
83+
"sharp": "^0.33.3",
8484
"typescript": "^5.0.4",
8585
"zrender": "^5.5.0"
8686
},

src/SVGCore.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,15 @@ export function vNodeToString(
5050
const S = opts.newline ? '\n' : '';
5151
function convertElToString(el: SVGVNode): string {
5252
const { children, tag, attrs } = el;
53-
// fix: https://github.com/Shopify/react-native-skia/issues/888
54-
if (attrs['stroke-width'] === 0) {
55-
attrs['stroke-opacity'] = 0;
53+
if (tag === 'path') {
54+
// fix: https://github.com/Shopify/react-native-skia/issues/888
55+
if (attrs['stroke-width'] === 0) {
56+
attrs['stroke-opacity'] = 0;
57+
}
58+
// fix: https://github.com/wuba/react-native-echarts/issues/161
59+
if (attrs.fill === 'transparent') {
60+
attrs['fill-opacity'] = 0;
61+
}
5662
}
5763
if (tag === 'text') {
5864
if (typeof attrs.style === 'string') {

0 commit comments

Comments
 (0)