File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
packages/uikit-react-native/src Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,12 @@ export default class InternalLocalCacheStorage implements AsyncLocalCacheStorage
4242
4343 async removeItem ( key : string ) {
4444 if ( this . _mmkv ) {
45- this . _mmkv . delete ( key ) ;
45+ // Support both v3.x (delete) and v4.x (remove) APIs for backward compatibility
46+ if ( this . _mmkv . delete ) {
47+ this . _mmkv . delete ( key ) ;
48+ } else if ( this . _mmkv . remove ) {
49+ this . _mmkv . remove ( key ) ;
50+ }
4651 } else if ( this . _async ) {
4752 return this . _async . removeItem ( key ) ;
4853 }
Original file line number Diff line number Diff line change @@ -18,7 +18,11 @@ export interface AsyncLocalCacheStorage {
1818 multiRemove ?( keys : string [ ] ) : Promise < void > ;
1919}
2020
21- export type MMKVLocalCacheStorage = Pick < MMKV , 'getString' | 'set' | 'delete' | 'getAllKeys' > ;
21+ export type MMKVLocalCacheStorage = Pick < MMKV , 'getString' | 'set' | 'getAllKeys' > & {
22+ // Support both v3.x (delete) and v4.x (remove) APIs for backward compatibility
23+ delete ?: ( key : string ) => void ;
24+ remove ?: ( key : string ) => void ;
25+ } ;
2226
2327export type ErrorBoundaryProps = { error : Error ; errorInfo : ErrorInfo ; reset : ( ) => void } ;
2428
You can’t perform that action at this time.
0 commit comments