Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fluffy-hornets-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-native-async-storage/async-storage": patch
---

keep .js extension for react-native-web support
4 changes: 2 additions & 2 deletions packages/async-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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",
Expand Down
10 changes: 10 additions & 0 deletions packages/async-storage/src/index.ts
Original file line number Diff line number Diff line change
@@ -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();