diff --git a/package-lock.json b/package-lock.json index 404dabb3906d..c898c1f7f5c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -115,7 +115,7 @@ "react-native-localize": "^3.5.4", "react-native-nitro-modules": "0.35.0", "react-native-nitro-sqlite": "9.6.0", - "react-native-onyx": "3.0.63", + "react-native-onyx": "3.0.66", "react-native-pager-view": "8.0.0", "react-native-pdf": "7.0.2", "react-native-permissions": "^5.4.0", @@ -34481,9 +34481,9 @@ } }, "node_modules/react-native-onyx": { - "version": "3.0.63", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-3.0.63.tgz", - "integrity": "sha512-6UUpjyUh9viXll9M2YomXM9PMg+791foSPA7E0fazgWfrUAmofNwo4xkXT4k3NDdToZFOYxaXL0uw5z00g/MOA==", + "version": "3.0.66", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-3.0.66.tgz", + "integrity": "sha512-pNDHZsJeSCJPrV9gw4igSTWXx8dayIaTkCQrRaENEPlbDNdRCSP7LSEc2VvyyMwDXRFCL/7CmXZOwRnF6wsUfg==", "license": "MIT", "dependencies": { "ascii-table": "0.0.9", diff --git a/package.json b/package.json index 138faffb48a7..574d9dcfb4ca 100644 --- a/package.json +++ b/package.json @@ -178,7 +178,7 @@ "react-native-localize": "^3.5.4", "react-native-nitro-modules": "0.35.0", "react-native-nitro-sqlite": "9.6.0", - "react-native-onyx": "3.0.63", + "react-native-onyx": "3.0.66", "react-native-pager-view": "8.0.0", "react-native-pdf": "7.0.2", "react-native-permissions": "^5.4.0", diff --git a/patches/react-native-onyx/details.md b/patches/react-native-onyx/details.md index 67ad7c054e85..719206af5632 100644 --- a/patches/react-native-onyx/details.md +++ b/patches/react-native-onyx/details.md @@ -1,6 +1,6 @@ # `react-native-onyx` patches -### [react-native-onyx+3.0.63.patch](react-native-onyx+3.0.63.patch) +### [react-native-onyx+3.0.66.patch](react-native-onyx+3.0.66.patch) - Reason: Onyx v3.0.59 ([PR #756](https://github.com/Expensify/react-native-onyx/pull/756)) added a state reset inside the `subscribe` callback of `useOnyx` to fix stale data when keys change dynamically. However, this reset runs unconditionally — including on initial mount — which causes `useSyncExternalStore` to see a new snapshot reference after subscription, triggering one extra render per `useOnyx` hook. This patch guards the reset with a `hasMountedRef` flag so it only runs on key-change re-subscriptions, not on initial mount. - E/App issue: https://github.com/Expensify/App/issues/85416 diff --git a/patches/react-native-onyx/react-native-onyx+3.0.63.patch b/patches/react-native-onyx/react-native-onyx+3.0.66.patch similarity index 100% rename from patches/react-native-onyx/react-native-onyx+3.0.63.patch rename to patches/react-native-onyx/react-native-onyx+3.0.66.patch