Skip to content

Commit 92e8253

Browse files
Evan YEvan Y
authored andcommitted
fix: web builds
1 parent 97c934d commit 92e8253

File tree

6 files changed

+970
-15
lines changed

6 files changed

+970
-15
lines changed

babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module.exports = {
22
presets: ["module:metro-react-native-babel-preset"],
3+
plugins: [["@babel/plugin-transform-react-jsx", { runtime: "automatic" }]],
34
};

example/ios/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1541,4 +1541,4 @@ SPEC CHECKSUMS:
15411541

15421542
PODFILE CHECKSUM: 0bd31d4d3637422db705fe5355565acd8e715825
15431543

1544-
COCOAPODS: 1.12.1
1544+
COCOAPODS: 1.15.2

example/metro.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ config.resolver.extraNodeModules = new Proxy(
2323
// excludes the one from the parent folder when bundling.
2424

2525
const IGNORED_LIBS = [
26+
"react",
2627
"react-dom",
2728
"react-native",
2829
"@shopify/react-native-skia",

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656
"d3-shape": "^3.2.0"
5757
},
5858
"devDependencies": {
59+
"@babel/plugin-transform-react-jsx": "^7.23.4",
60+
"@babel/preset-env": "^7.24.5",
61+
"@babel/preset-react": "^7.24.1",
5962
"@commitlint/config-conventional": "^17.0.2",
6063
"@evilmartians/lefthook": "^1.2.2",
6164
"@release-it/conventional-changelog": "^5.0.0",
@@ -74,6 +77,7 @@
7477
"eslint-plugin-prettier": "^5.1.3",
7578
"husky": "^8.0.0",
7679
"jest": "^28.1.1",
80+
"metro-react-native-babel-preset": "^0.77.0",
7781
"prettier": "^3.2.5",
7882
"react": "^18.3.1",
7983
"react-dom": "^18.3.1",
@@ -130,7 +134,12 @@
130134
"output": "lib",
131135
"targets": [
132136
"commonjs",
133-
"module",
137+
[
138+
"module",
139+
{
140+
"configFile": true
141+
}
142+
],
134143
[
135144
"typescript",
136145
{

src/components/LineChart/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Canvas, Path } from "@shopify/react-native-skia";
2-
import React, { useCallback, useMemo, useState } from "react";
2+
import { useCallback, useMemo, useState } from "react";
33
import { LayoutChangeEvent, StyleSheet, View, ViewProps } from "react-native";
44
import { GestureDetector } from "react-native-gesture-handler";
55
import { useSharedValue } from "react-native-reanimated";

0 commit comments

Comments
 (0)