diff --git a/.gitignore b/.gitignore index 7535671..4488498 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ .expo/ # VSCode -.vscode/ jsconfig.json # Xcode @@ -67,4 +66,4 @@ android/keystores/debug.keystore .turbo/ # generated by bob -lib/ +./lib/ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..23fd35f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "editor.formatOnSave": true +} \ No newline at end of file diff --git a/package.json b/package.json index 3782f2b..a728288 100644 --- a/package.json +++ b/package.json @@ -75,6 +75,7 @@ "husky": "^8.0.0", "jest": "^28.1.1", "prettier": "^3.2.5", + "react": "^18.3.1", "react-dom": "^18.3.1", "react-native-builder-bob": "^0.20.4", "react-native-gesture-handler": "^2.15.0", @@ -83,9 +84,6 @@ "release-it": "^15.0.0", "typescript": "^4.5.2" }, - "resolutions": { - "@types/react": "17.0.21" - }, "peerDependencies": { "@shopify/react-native-skia": "1.0.2", "react": ">=18.0.0", diff --git a/src/components/LineChart/index.tsx b/src/components/LineChart/index.tsx index 7d1d378..e443dbe 100644 --- a/src/components/LineChart/index.tsx +++ b/src/components/LineChart/index.tsx @@ -1,5 +1,5 @@ import { Canvas, Path } from "@shopify/react-native-skia"; -import { useCallback, useMemo, useState } from "react"; +import React, { useCallback, useMemo, useState } from "react"; import { LayoutChangeEvent, StyleSheet, View, ViewProps } from "react-native"; import { GestureDetector } from "react-native-gesture-handler"; import { useSharedValue } from "react-native-reanimated"; diff --git a/src/lib/batchedUpdates.ts b/src/lib/batchedUpdates.ts new file mode 100644 index 0000000..1d04e00 --- /dev/null +++ b/src/lib/batchedUpdates.ts @@ -0,0 +1 @@ +export { unstable_batchedUpdates as batchedUpdates } from "react-native"; diff --git a/src/lib/batchedUpdates.web.ts b/src/lib/batchedUpdates.web.ts new file mode 100644 index 0000000..a901d0a --- /dev/null +++ b/src/lib/batchedUpdates.web.ts @@ -0,0 +1 @@ +export { unstable_batchedUpdates as batchedUpdates } from "react-dom"; diff --git a/yarn.lock b/yarn.lock index cddbb1a..7613470 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2148,7 +2148,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@17.0.21": +"@types/react@*": version "17.0.21" resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.21.tgz#069c43177cd419afaab5ce26bb4e9056549f7ea6" integrity sha512-GzzXCpOthOjXvrAUFQwU/svyxu658cwu00Q9ugujS4qc1zXgLFaO0kS2SLOaMWLt2Jik781yuHCWB7UcYdGAeQ== @@ -7088,6 +7088,13 @@ react-reconciler@0.27.0: loose-envify "^1.1.0" scheduler "^0.21.0" +react@^18.3.1: + version "18.3.1" + resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891" + integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ== + dependencies: + loose-envify "^1.1.0" + read-pkg-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07"