From bc0ce4d33a18dc7f6257dfc14aa2d5056398c6c2 Mon Sep 17 00:00:00 2001 From: Krzysztof Borowy <6444719+krizzu@users.noreply.github.com> Date: Mon, 23 Feb 2026 15:58:31 +0100 Subject: [PATCH 1/2] fix: react native web --- packages/async-storage/package.json | 4 ++-- .../async-storage/src/{index.tsx => index.native.ts} | 0 packages/async-storage/src/index.ts | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) rename packages/async-storage/src/{index.tsx => index.native.ts} (100%) create mode 100644 packages/async-storage/src/index.ts diff --git a/packages/async-storage/package.json b/packages/async-storage/package.json index e0d2a092..d7b2bc0d 100644 --- a/packages/async-storage/package.json +++ b/packages/async-storage/package.json @@ -6,7 +6,7 @@ "types": "./lib/typescript/index.d.ts", "exports": { ".": { - "source": "./src/index.tsx", + "source": "./src/index.ts", "types": "./lib/typescript/index.d.ts", "default": "./lib/module/index.js" }, @@ -17,7 +17,7 @@ "build": "del-cli lib && bob build", "build:watch": "watch 'bob build' src", "test:ts": "tsc --noEmit", - "test:lint": "eslint src/*.{js,ts,tsx}" + "test:lint": "eslint src/*.{js,ts}" }, "files": [ "src", diff --git a/packages/async-storage/src/index.tsx b/packages/async-storage/src/index.native.ts similarity index 100% rename from packages/async-storage/src/index.tsx rename to packages/async-storage/src/index.native.ts diff --git a/packages/async-storage/src/index.ts b/packages/async-storage/src/index.ts new file mode 100644 index 00000000..647601ec --- /dev/null +++ b/packages/async-storage/src/index.ts @@ -0,0 +1,10 @@ +// note: .js extensions are kept to support react native web +import { getLegacyStorage } from "./createAsyncStorage.js"; + +export type { AsyncStorage } from "./AsyncStorage"; +export { createAsyncStorage } from "./createAsyncStorage.js"; + +export { AsyncStorageError } from "./AsyncStorageError"; + +// Legacy storage that is proxy to an old storage data. +export default getLegacyStorage(); From 75d7f8dec324884abaff5cf5a7e6f16b905ffef9 Mon Sep 17 00:00:00 2001 From: Krzysztof Borowy <6444719+krizzu@users.noreply.github.com> Date: Mon, 23 Feb 2026 15:58:49 +0100 Subject: [PATCH 2/2] docs(changeset): keep .js extension for react-native-web support --- .changeset/fluffy-hornets-joke.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fluffy-hornets-joke.md diff --git a/.changeset/fluffy-hornets-joke.md b/.changeset/fluffy-hornets-joke.md new file mode 100644 index 00000000..db3512ed --- /dev/null +++ b/.changeset/fluffy-hornets-joke.md @@ -0,0 +1,5 @@ +--- +"@react-native-async-storage/async-storage": patch +--- + +keep .js extension for react-native-web support